Skip to content

Instantly share code, notes, and snippets.

View austinbv's full-sized avatar
🎯
Focusing

Austin austinbv

🎯
Focusing
View GitHub Profile
@austinbv
austinbv / gist:3112678
Created July 14, 2012 18:55 — forked from anonymous/gist:3112657
UserPasswordResetsController
require 'spec_helper'
describe UserPasswordResetsController do
describe 'POST #create' do
before(:each) do
@user = create(:user, customer_id: 1, email: '[email protected]')
end
let(:make_valid_request) { post :create, { email: '[email protected]' } }
class Artist < ActiveRecord::Base
has_many :albums
belongs_to :record_label
def albums
return 5
end
end
console.log(new Date);
var x = 0;
(function timeCheck() {
if (x == 3) Date = 'swear jar';
setTimeout(function(){
console.log('go go power rangers');
setTimeout(timeCheck, 0);
}, 1000);
x++;
var Timecop = require('./timecop'),
repl = require("repl");
repl.start({
prompt: '> ',
input: process.stdin,
output: process.stdout
});
___ ruby ____
do_something('first')
do_something('second')
___javascript__
doSomething('first')
doSomething('second')
(function() {
var sleep = function(ms, callback) {
var start = new Date().getTime(), finished;
while(!finished) {
if ((new Date().getTime() - start) > ms){
finished = true;
}
}
if (callback)
describe('with a date spelled out in numbers as arguments', function(done) {
beforeEach(function() {
this.timeout(500);
Timecop.freeze(2008, 6, 5, 14, 30, 15, 450);
});
it('should stop time', function(done) {
var self = this;
var date1 = new Date();
setTimeout(function() {
> require File.expand_path('~/.weechat_passwords')
LoadError: cannot load such file -- /Users/austinbv/.weechat_passwords
from /Users/austinbv/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /Users/austinbv/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from (irb):1
from /Users/austinbv/.rvm/rubies/ruby-1.9.3-p194/bin/irb:16:in `<main>'
> load File.expand_path('~/.weechat_passwords')
=> true
#! /usr/bin/env ruby
load File.expand_path '~/.weechat_passwords'
def weechat_init
Weechat.register "identify_for_freenode", "austinbv", "0.1", "MIT", "idenfify my nick", "", ""
buffer = Weechat.info_get "irc_buffer", "freenode"
Weechat.command buffer, "/msg NickServ identify #{Passwords::Freenode.password}"
end
/**
* Module dependencies.
*/
var express = require('express'),
routes = require('./routes');
var app = module.exports = express.createServer();
// Configuration