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
@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>
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.
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
$.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',
});
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,
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
@BlakeWilliams
BlakeWilliams / gist:5458208
Created April 25, 2013 08:00
Rake task for minitest-rails stats. Slightly incomplete.
task :stats => "test:statssetup"
namespace :test do
task :statssetup do
require 'rails/code_statistics'
['controllers', 'helpers', 'models'] .each do |type|
dir = "test/#{type}"
::STATS_DIRECTORIES << ["#{type} tests", dir]
::CodeStatistics::TEST_TYPES << "#{type} tests"
end
PS1="\u:\W \[\e[1;33m\]⚡\[\e[0m\] "
App.PickADate = Ember.View.extend({
attributes: ['monthsFull', 'monthsShort', 'weekdaysFull', 'weekdaysShort',
'monthPrev', 'monthNext', 'showMonthsFull', 'showWeekdaysShort', 'today',
'clear', 'format', 'formatSubmit', 'hiddenSuffix', 'firstDay', 'monthSelector',
'yearSelector', 'dateMin', 'dateMax', 'datesDisabled', 'disablePicker'],
events: ['onOpen', 'onClose', 'onSelect', 'onStart'],
tagName: 'input',
classNames: 'pickadate',
@BlakeWilliams
BlakeWilliams / PickADate.js
Last active December 15, 2015 21:19
Custom Ember view for the jQuery PickADate plugin.
App.PickADate = Ember.View.extend({
attributes: ['monthsFull', 'monthsShort', 'weekdaysFull', 'weekdaysShort',
'monthPrev', 'monthNext', 'showMonthsFull', 'showWeekdaysShort', 'today',
'clear', 'format', 'formatSubmit', 'hiddenSuffix', 'firstDay', 'monthSelector',
'yearSelector', 'dateMin', 'dateMax', 'datesDisabled', 'disablePicker'],
events: ['onOpen', 'onClose', 'onSelect', 'onStart'],
attributeBindings: ['type', 'value', 'placeholder'],
type: 'text',
tagName: 'input',