Skip to content

Instantly share code, notes, and snippets.

View digitaltoad's full-sized avatar

Joshua Borton digitaltoad

  • Amplify
  • Tecumseh, Michigan
View GitHub Profile
fetch('/logout', { credentials: 'include' })
.then(function(resp) {
return fetch('/login', { credentials: 'include' })
})
.then(function(resp) {
return resp.text()
})
.then(function(body) {
$('body')
.html($('<div></div>').html($(body)).filter('.container')[0])
@digitaltoad
digitaltoad / gist:3906311
Created October 17, 2012 15:51
What have I missed
class Foo
@bar = []
class << self
attr_accessor :bar
end
end
# Ruby 1.9.2-p290
Foo.bar #=> []
@digitaltoad
digitaltoad / gist:1701982
Created January 30, 2012 02:18
jQuery callback example
$('.hide-welcome').click(function() {
$('#welcome').fadeOut('fast', function() {
$('#getting-started').fadeIn('fast');
});
});
// Add an else statement in case the number is divisible by 5.
// for the numbers 1 through 20,
for (i=1; i<=20; i++) {
if ( i % 5 === 0 && i % 3 === 0) {
console.log("FizzBuzz");
} else if ( i % 3 === 0 ) {
console.log("Fizz");
} else if ( i % 5 === 0 ) {
console.log("Buzz");
Rails.application.routes.draw do
resource :home
root :to => 'home#index'
end
Rails.application.routes.draw do
web_start
web_start_required_for do
resource :home
root :to => 'home#index'
@digitaltoad
digitaltoad / gist:1169659
Created August 25, 2011 00:30
Overriding establish_connection
module Interceptor
def self.included(base)
base.class_eval do
alias_method :establish_connection_before_interception, :establish_connection
def establish_connection
"intercepted"
end
end
end
local db = TukuiDB["tooltip"]
if not db.enable then return end
-- Texture tooltips
local tooltips = {
GameTooltip,
ItemRefTooltip,
ShoppingTooltip1,
ShoppingTooltip2,
ShoppingTooltip3,
-- ACTION BAR PANEL
TukuiDB.buttonsize = TukuiDB:Scale(27)
TukuiDB.buttonspacing = TukuiDB:Scale(4)
TukuiDB.petbuttonsize = TukuiDB:Scale(29)
TukuiDB.petbuttonspacing = TukuiDB:Scale(4)
local barbg = CreateFrame("Frame", "TukuiActionBarBackground", UIParent)
TukuiDB:CreatePanel(barbg, 1, 1, "BOTTOM", UIParent, "BOTTOM", 0, TukuiDB:Scale(14))
if TukuiDB.lowversion == true then
barbg:SetWidth((TukuiDB.buttonsize * 12) + (TukuiDB.buttonspacing * 13))
file 'Gemfile', <<-GEMS
source 'http://gemcutter.org'
gem "rails", "3.0.0.beta4"
gem "bson_ext"
gem "mongoid", "2.0.0.beta7"
gem "haml", "3.0.12"
gem "compass", "0.10.2"
gem "inherited_resources"
gem "devise", :git => 'git://github.com/plataformatec/devise.git'