This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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]' } } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Artist < ActiveRecord::Base | |
| has_many :albums | |
| belongs_to :record_label | |
| def albums | |
| return 5 | |
| end | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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++; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var Timecop = require('./timecop'), | |
| repl = require("repl"); | |
| repl.start({ | |
| prompt: '> ', | |
| input: process.stdin, | |
| output: process.stdout | |
| }); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ___ ruby ____ | |
| do_something('first') | |
| do_something('second') | |
| ___javascript__ | |
| doSomething('first') | |
| doSomething('second') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (function() { | |
| var sleep = function(ms, callback) { | |
| var start = new Date().getTime(), finished; | |
| while(!finished) { | |
| if ((new Date().getTime() - start) > ms){ | |
| finished = true; | |
| } | |
| } | |
| if (callback) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| > 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #! /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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Module dependencies. | |
| */ | |
| var express = require('express'), | |
| routes = require('./routes'); | |
| var app = module.exports = express.createServer(); | |
| // Configuration |