Skip to content

Instantly share code, notes, and snippets.

View mikespokefire's full-sized avatar

Michael Smith mikespokefire

View GitHub Profile
@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:

# 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
# 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
@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";
// ============================================================================
@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!
class AdminController < ApplicationController
layout "admin"
http_basic_authenticate_with :name => "user", :password => "password"
end
def index
@all_coasters = Coaster.all
@coasters = @all_coasters
Coaster.include_root_in_json = false
end
var myFunc = function() {
console.log(this); //currently outs DOMelement
};
if ($('body.home').length) {
$('.slideshow').cycle({
after: myFunc
});
}
namespace :flickr do
desc "Pull all data from Flickr"
task :pull => :environment do
# Remove everything to do with the gallery
#Album.destroy_all
#Photo.destroy_all
def pending_orders?
orders.where(:status => Order::PENDING).exists?
end