Skip to content

Instantly share code, notes, and snippets.

View BlakeWilliams's full-sized avatar
💭
building things, probably

Blake Williams BlakeWilliams

💭
building things, probably
View GitHub Profile
namespace :deploy do
task :symlink_config, roles: :app do
run "rm #{release_path}/config/database.yml"
run "ln -nfs #{shared_path}/config/database.yml #{release_path}/config/database.yml"
end
after "deploy:finalize_update", "deploy:symlink_config"
end
App.FoodController = Ember.ArrayController.extend({
needs: 'table',
tableBinding: 'controllers.table',
addFood: function(food) {
var table = this.get('table').get('content')
tabItems = table.get('tab.tabItems');
tabItems.createRecord({
food: food,
$.ajax({
url: 'https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=-33.8670522,151.1957362&radius=500&types=food&name=harbour&sensor=false&key=AIzaSyCQdt0PINcQqpoZiviY731oUEprhc84yO8&callback=',
type: 'GET',
crossDomain: true,
dataType: 'jsonp',
});
config.before(:suite) do
DatabaseCleaner.clean_with(:deletion)
end
config.before(:each) do
DatabaseCleaner.strategy = :transaction
end
config.before(:each, js: true) do
DatabaseCleaner.strategy = :deletion
require 'capybara'
require 'capybara/dsl'
require 'capybara/poltergeist'
Capybara.register_driver :poltergeist do |app|
Capybara::Poltergeist::Driver.new(app, logger: nil, phantomjs_logger: nil)
end
class ApplicationController < ActionController::Base
# Prevent CSRF attacks by raising an exception.
@BlakeWilliams
BlakeWilliams / base16-wasteland.dark.itermcolors
Created July 9, 2014 01:48
base16-wasteland.dark.itermcolors
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Ansi 0 Color</key>
<dict>
<key>Color Space</key>
<string>sRGB</string>
<key>Blue Component</key>
<real>0.1568627450980392</real>
import System.Random
guessNumber :: Int -> IO ()
guessNumber answer = do
guess <- getLine
if read guess == answer
then putStrLn "You Win!"
else guessWrong answer (read guess)
guessWrong :: Int -> Int -> IO ()
@BlakeWilliams
BlakeWilliams / wasteland.yml
Created October 13, 2014 01:03
YAML for my custom colorscheme generated with base16. Based on Gruvbox
scheme: "Wasteland"
author: "foobar"
base00: "282828"
base01: "32302f"
base02: "3c3836"
base03: "504945"
base04: "665c54"
base05: "d5c4a1"
base06: "ebdbb2"
base07: "fdf4c1"
# Stupid simple script for OS X that uses the terminal-notifier script to
# send notifications via Notification Center. It has literally 0 configuration.
def weechat_init
Weechat.register(
"terminal_notifier",
"Blake Williams",
"0.2",
"BSD",
"Use terminal-notifier for highlights",
! Base16 Wasteland
! Scheme: foobar
#define base00 #282828
#define base01 #32302f
#define base02 #3c3836
#define base03 #504945
#define base04 #665c54
#define base05 #d5c4a1
#define base06 #ebdbb2