This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# Requires ftxdumperfuser from http://developer.apple.com/textfonts/download/ | |
# | |
# Usage: fixconsolas [files ...] | |
# When called with no arguments, it attempts to operate on every TrueType | |
# file in the current directory. | |
# | |
# References: | |
# http://bandes-storch.net/blog/2008/12/21/consolas-controlled/#comment-2042 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'oauth' | |
consumer_key = '...' # from SalesForce | |
consumer_secret = '...' # from SalesForce | |
oauth_options = { | |
:site => 'https://login.salesforce.com', | |
:scheme => :body, | |
:request_token_path => '/_nc_external/system/security/oauth/RequestTokenHandler', | |
:authorize_path => '/setup/secur/RemoteAccessAuthorizationPage.apexp', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Wide-open CORS config for nginx | |
# | |
location / { | |
if ($request_method = 'OPTIONS') { | |
add_header 'Access-Control-Allow-Origin' '*'; | |
# |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
source "http://rubygems.org" | |
group :development do | |
gem 'rake' | |
gem 'guard' | |
gem 'coffee-script' | |
gem 'rb-fsevent' | |
gem 'rb-inotify' | |
gem 'compass', '0.11.5' | |
gem 'sass', '3.1.5' | |
gem 'guard-compass' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Inspired by https://github.com/logicalparadox/backbone.iobind/blob/master/lib/sync.js | |
// Overwrite Backbone.sync method | |
Backbone.sync = function(method, model, options){ | |
// create a connection to the server | |
var ws = new WebSocket('ws://127.0.0.1:1234'); | |
// send the command in url only if the connection is opened | |
// command attribute is used in server-side. | |
ws.onopen = function(){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bt = Brand.arel_table | |
bft = BrandFollower.arel_table | |
user = User.first | |
outer_join = Arel::Nodes::OuterJoin.new(bft, Arel::Nodes::On.new(bft[:brand_id].eq(bt[:id]))) | |
brand_follower = bft[:role].eq(:editor).and(bft[:follower_id].eq(user.id)) | |
Brand.joins(outer_join).where(bt[:published].eq(true).or(brand_follower)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* The CSS for targeting trailing nodes in a grid with rows of 4 nodes */ | |
div:nth-last-child(-n+3):nth-child(4n+1), | |
div:nth-last-child(-n+2):nth-child(4n+2), | |
div:nth-last-child(-n+1):nth-child(4n+3) { | |
background: blue; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# You need to download the jar from http://plantuml.sourceforge.net/ and put in ~/plantuml | |
# or alter the path below | |
java -jar ~/plantuml/plantuml.jar -tpng $@ | |
open ${@%plantuml}png |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# db/migrate/XXXXXXXXXXXXX_add_authentication_token_to_users.rb | |
class AddAuthenticationTokenToUsers < ActiveRecord::Migration | |
def change | |
add_column :users, :authentication_token, :string | |
add_index :users, :authentication_token, :unique => true | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This simplest thing is to clone Jim's repo (https://github.com/jimweirich/gilded_rose_kata) and then | |
# put this file in the root directory. | |
gem 'minitest', '~> 4.7' | |
require "minitest/autorun" | |
require "minitest/reporters" | |
MiniTest::Reporters.use! MiniTest::Reporters::SpecReporter.new | |
require_relative './gilded_rose' |
OlderNewer