Skip to content

Instantly share code, notes, and snippets.

View jsmestad's full-sized avatar
👾

Justin Smestad jsmestad

👾
View GitHub Profile
@usergenic
usergenic / TA8522-benchmarks.rb
Created October 13, 2011 23:21
FQL vs Graph
#!/usr/bin/env ruby
require 'rubygems'
require 'koala'
require 'benchmark'
require 'optparse'
require 'yaml'
require 'json'
@session_token = nil
@ubermajestix
ubermajestix / Rakefile
Created September 22, 2011 19:00
Rake tasks for managing your spork server. Check the Rakefile to bypass loading Rails to run these rake tasks super fast.
#!/usr/bin/env rake
# Add your own tasks in files placed in lib/tasks ending in .rake,
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
# If certain tasks are called, don't load Rails!
if %w(spork:start spork:restart spork:stop).include?(Rake.application.top_level_tasks.first)
# Load the rake tasks
Dir.glob("#{File.expand_path("../lib/tasks", __FILE__)}/*.rake").each { |r| import r }
else
require File.expand_path('../config/application', __FILE__)
@copiousfreetime
copiousfreetime / ip-down
Created September 1, 2011 20:24
PPP ip-up/ip-down for vpn with optional dns resolving
#!/bin/sh
# install into /etc/ppp/ip-down
# chmod a+x /etc/ppp/ip-down
source /etc/ppp/ip.config
case "${IPREMOTE}" in
${MY_IPREMOTE})
/sbin/route delete ${MY_ROUTE} -interface ${IFNAME}
$.ajaxSetup({
cache: false,
dataType: 'json'
});
SC.RestDataSource = SC.DataSource.extend({
resourceURL: function(recordType, store, storeKey) {
var id, resourceName = recordType.resourceName,
prefix = this.get('storagePrefix');
@bsodmike
bsodmike / development.rb
Created August 29, 2011 08:14 — forked from MyArtChannel/development.rb
Use Pry as IRB replacement in rails 3 console
# Add this to the end of your development.rb and add
#
# gem 'pry'
#
# to your Gemfile and run bundle to install.
silence_warnings do
begin
require 'pry'
IRB = Pry
@wycats
wycats / sc-notes.mkd
Created August 21, 2011 21:33 — forked from paul/sc-notes.mkd

Sproutcore 2.0 questions

I'm trying to write a complicated app in SC2. There's no editing component yet, just a display of (lots of data). Starting from the Todos & Handlebars guides, here's some of the stuff I've had to google for, or wasn't readily obvious.

Note: I like coffeescript and haml

  • Why is there sometimes references to SC.ArrayController?

    • Colin C: it was gone but its back now. we need to generate the docs again.
  • Why is App.fooController an SC.Object, and App.foosController an SC.ArrayProxy? Shouldn't there just be a generic SC.Controller, or SC.CollectionController, if the behavior is different?

@ajsharp
ajsharp / airbrakeapp.com.js
Created August 17, 2011 23:48
DotJS script to create github issues from AirbrakeApp error pages
// NOTE: You need dotjs installed to use this: https://github.com/defunkt/dotjs
//
// You must name this file with your airbrakeapp subdomain prepended to the filename.
// Example: So myairbrakesubdomain.airbrakeapp.com.js
var login = "<GITHUB USERNAME>";
var token = "<GITHUB TOKEN>";
var title = $("#notice_heading h2").text();
var link = document.location.href;
@kyriacos
kyriacos / Deploy
Created August 5, 2011 17:47 — forked from coop/Deploy
Deploy to S3 - Asset Pipeline, S3 and Heroku
namespace :deploy do
desc "Deploy to Heroku"
task :heroku do
Rake::Task["deploy:precompile_assets_and_upload_to_s3"].invoke
Rake::Task["deploy:push_heroku"].invoke
end
desc "Precompile assets and upload to s3"
task :precompile_assets_and_upload_to_s3 do
storage = Fog::Storage.new :provider => 'AWS', :aws_access_key_id => "123", :aws_secret_access_key => "123"
@chrisgaunt
chrisgaunt / rails_test_engine_cucumber.markdown
Created August 3, 2011 03:57
Rails 3.1: Test engine with Cucumber & test/dummy app

Run from the root of the engine project:

rails generate cucumber:install --capybara

Edit features/support/env.rb and add to the top:

ENV["RAILS_ENV"] ||= "test"
require File.expand_path("../../../test/dummy/config/environment.rb",  __FILE__)
ENV["RAILS_ROOT"] ||= File.dirname(__FILE__) + "../../../test/dummy"
@jsmestad
jsmestad / assets.yml
Created July 27, 2011 20:43
Rails 3.0.x runtime compilation and asset packaging with Barista and Jammit on Heroku
# config/assets.yml
package_assets: on
compress_assets: on
# compress_assets: off
javascript_compressor: uglifier
javascripts:
all: