Skip to content

Instantly share code, notes, and snippets.

View shillcock's full-sized avatar

Scott Shillcock shillcock

View GitHub Profile
class CreateVideos < ActiveRecord::Migration
def change
create_table :videos do |t|
t.string :video
t.text :meta_info
t.timestamps
end
end
end
class Attachment < ActiveRecord::Base
belongs_to :attachable, :polymorphic => true
mount_uploader :item, AttachmentUploader
# background the storage of files to AWS and processing
# makes for fast uploads!
store_in_background :item
attr_accessible :item
before_save :update_attachment_attributes
require "spec_helper"
describe ExampleController do
context "GET #index" do
let(:resources) { FactoryGirl.create_list(:resource) }
before do
get :index
end
RSpec.configure do |config|
config.before(:suite) do
DatabaseCleaner.clean_with(:truncation)
end
config.before(:each) do
DatabaseCleaner.strategy = :transaction
end
config.before(:each, js: true) do
=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')
@shillcock
shillcock / hack.sh
Created April 2, 2012 19:06 — forked from erikh/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
var
fs = require('fs'),
sys = require('sys'),
http = require('http'),
client = http.createClient(80, 'build.chromium.org'),
urlPath = '/buildbot/snapshots/chromium-rel-mac/',
filename = 'chrome-mac.zip',
dir = 'chrome-mac',
path = '/tmp/',
ext = '.zip',
@shillcock
shillcock / serve.js
Created February 8, 2010 19:28 — forked from gjritter/serve.js
/*global require, process */
(function() {
var http = require('http'), posix = require('posix'), url = require('url'), cache = {}, mime_types = {};
function extname(path) {
var index = path.lastIndexOf('.');
if (index < 0) {
return;
}
return path.slice(index + 1);
var posix = require('posix'),
sys = require('sys'),
http = require('http');
http.createServer(function (req, res) {
checkBalanceFile(req, res);
}).listen(8000);
function checkBalanceFile(req, res) {
var promise = posix.stat("balance");
*.pbxproj -crlf -diff -merge