Skip to content

Instantly share code, notes, and snippets.

View mikespokefire's full-sized avatar

Michael Smith mikespokefire

View GitHub Profile
def index
@all_coasters = Coaster.all
@coasters = @all_coasters
Coaster.include_root_in_json = false
end
class AdminController < ApplicationController
layout "admin"
http_basic_authenticate_with :name => "user", :password => "password"
end
@mikespokefire
mikespokefire / gist:3774881
Created September 24, 2012 08:09
Marking fields as dirty in Mongoid and ActiveRecord
class Muppet
include Mongoid::Document
field :tags, Array
end
m = Muppet.new(:biography => ['a', 'b', 'c'])
m.save
m.tags.pop
m.tags_will_change!
@mikespokefire
mikespokefire / my_class.js
Last active December 14, 2015 08:28
Object Orientated JavaScript
"use strict";
var MyClass = (function() {
function MyClass(publicString) {
this.publicString = publicString;
};
var privateString = "I'm a private string that can't be accessed directly";
// ============================================================================
# The actual matcher class
class VirtusAttributeMatcher
# initialize is called with the expected outcome
# => expect(described_class).to have_attribute(:token)
def initialize(attribute_name)
@attribute_name = attribute_name
@options = {}
end
# When RSpec will call matches? on the expectation class, this needs to
# On Machine A
serf agent -bind 192.168.50.10
# On Machine B
serf agent -bind 192.168.50.20
serf join 192.168.50.10
# On Machine A (with some time between each command)
serf event deploy feature/testing
serf event test-event payload
@mikespokefire
mikespokefire / keybase.md
Created August 4, 2016 10:28
keybase.md

Keybase proof

I hereby claim:

  • I am mikespokefire on github.
  • I am mikespokefire (https://keybase.io/mikespokefire) on keybase.
  • I have a public key whose fingerprint is 7DAC 9902 9F83 0A17 21F5 AE10 5758 4673 88FA B364

To claim this, I am signing this object: