Skip to content

Instantly share code, notes, and snippets.

View mhoad's full-sized avatar

Mark Hoad mhoad

  • Sydney, Australia
View GitHub Profile
@adilinden
adilinden / guac_build.md
Last active October 1, 2020 11:45
Building apache/guacamole on Ubuntu 18.04

Guacamole

This is a HTML5 to RDP gateway

Base System

Ubuntu 18.04 installed from my template.

First Login

@pcreux
pcreux / 000_robust_rails_apps.md
Last active May 14, 2018 04:38
Robust Rails Apps - VanRuby - March 29, 2017

Robust Rails Apps

Philippe Creux - @pcreux

#vanruby - March 29th, 2017

anonymous
anonymous / cart_page.liquid
Created May 26, 2015 17:30
Custom Code for Google Analytics Remarketing on Shopify
<!-- Cart Page -->
<!-- To be added before the closing body tag -->
<script type="text/javascript">
var google_tag_params = {
ecomm_prodid: [{% for item in cart.items %}'{{item.product.id}}',{% endfor %}],
ecomm_pagetype: 'cart',
ecomm_totalvalue: [{% for item in cart.items %}'{{item.line_price | money_without_currency }}',{% endfor %}],
};
</script>
<script type="text/javascript">
require 'rails_helper'
RSpec.describe TodosController, :type => :controller do
describe "GET #index" do
#describe "POST #create" do
#describe "GET #show" do
#describe "PATCH #update" do (or PUT #update)
#describe "DELETE #destroy" do
#describe "GET #new" do
@PWSdelta
PWSdelta / rspec_model_testing_template.rb
Last active July 29, 2025 13:52
Rails Rspec model testing skeleton & cheat sheet using rspec-rails, shoulda-matchers, shoulda-callbacks, and factory_girl_rails. Pretty much a brain dump of examples of what you can (should?) test in a model. Pick & choose what you like, and please let me know if there are any errors or new/changed features out there. Reddit comment thread: http…
# This is a skeleton for testing models including examples of validations, callbacks,
# scopes, instance & class methods, associations, and more.
# Pick and choose what you want, as all models don't NEED to be tested at this depth.
#
# I'm always eager to hear new tips & suggestions as I'm still new to testing,
# so if you have any, please share!
#
# This skeleton also assumes you're using the following gems:
#
# rspec-rails: https://github.com/rspec/rspec-rails
@tbrianjones
tbrianjones / free_email_provider_domains.txt
Last active October 18, 2025 23:08
A list of free email provider domains. Some of these are probably not around anymore. I've combined a dozen lists from around the web. Current "major providers" should all be in here as of the date this is created.
1033edge.com
11mail.com
123.com
123box.net
123india.com
123mail.cl
123qwe.co.uk
126.com
150ml.com
15meg4free.com
@jhjguxin
jhjguxin / creating-nested-resources-in-ruby-on-rails-3-and-updating-scaffolding-links-and-redirection.markdown
Created July 9, 2012 03:32
Creating nested resources in ruby on rails 3 and updating scaffolding links and redirection
@them0nk
them0nk / rspec_rails_cheetsheet.rb
Created March 23, 2012 03:39
Rspec Rails cheatsheet (include capybara matchers)
#Model
@user.should have(1).error_on(:username) # Checks whether there is an error in username
@user.errors[:username].should include("can't be blank") # check for the error message
#Rendering
response.should render_template(:index)
#Redirecting
response.should redirect_to(movies_path)