This file contains 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
[server] | |
freenode.addresses = "chat.freenode.net/6667" | |
freenode.proxy | |
freenode.ipv6 | |
freenode.ssl | |
freenode.ssl_cert | |
freenode.ssl_priorities | |
freenode.ssl_dhkey_size | |
freenode.ssl_verify | |
freenode.password |
This file contains 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
(rdb:1) help save | |
save [FILE] | |
Saves current debugger state to FILE as a script file. | |
This includes breakpoints, catchpoints, display expressions and some settings. | |
If no filename is given, we will fabricate one. | |
Use the 'source' command in another debug session to restore them. | |
(rdb:1) help source | |
source FILE executes a file containing debugger commands | |
(rdb:1) |
This file contains 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 app = require('http').createServer(handler) | |
, io = require('socket.io').listen(app) | |
, fs = require('fs') | |
app.listen(80); | |
function handler (req, res) { | |
fs.readFile(__dirname + '/index.html', | |
function (err, data) { | |
if (err) { |
This file contains 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 LineItem < ActiveRecord::Base | |
belongs_to :product | |
belongs_to :order | |
validates :price, :quantity, numericality: true | |
validates :product_id, :order_id, presence: true | |
end |
This file contains 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 Order < ActiveRecord::Base | |
has_many :line_items | |
validates :total_price, numericality: true | |
before_create :apply_returning_customer_discount, if: lambda { |order| order.returning_customer? } | |
def apply_returning_customer_discount | |
self.total_price = self.total_price * 0.9 | |
end |
This file contains 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 Product < ActiveRecord::Base | |
validates :price, numericality: true | |
end |
This file contains 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
~ 1.9.3-p194 $ cd Documents/projects/activeadmin-xlsx/ | |
~/Documents/projects/activeadmin-xlsx (wip) 1.9.3-p194 $ be rake | |
/Users/jonathanwallace/.rbenv/versions/1.9.3-p194/bin/ruby -S rspec ./spec/lib/active_admin/xlsx/settings_spec.rb | |
ActiveAdmin requires meta_search >= 1.1.0.pre and sass-rails ~> 3.1.0.rc to work with rails >= 3.1.0 | |
Mocha deprecation warning: Test::Unit or MiniTest must be loaded *before* Mocha. | |
Mocha deprecation warning: If you're integrating with another test library, you should probably require 'mocha_standalone' instead of 'mocha' | |
F | |
Failures: |
This file contains 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
root@wallaces-desktop:/home/kristina/Downloads# apt-get remove scratch | |
Reading package lists... Done | |
Building dependency tree | |
Reading state information... Done | |
The following packages will be REMOVED: | |
scratch | |
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded. | |
1 not fully installed or removed. | |
After this operation, 46.7 MB disk space will be freed. | |
Do you want to continue [Y/n]? Y |
This file contains 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 ImportJob | |
extend Resque::Plugins::LonelyJob | |
def self.enqueue(account_id, import_id) | |
# All enqueued resque jobs have the same payload | |
Resque.enqueue(ImportJob, account_id) | |
# but we drop the import_id into an account specific | |
# redis list that we use when actually processing jobs to preserve job order | |
enqueue_payload(account_id, import_id) |
This file contains 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
# Extracted from https://github.com/wallace/resque-lonely_job/blob/master/lib/resque-lonely_job.rb#L12-L16 | |
# Overwrite this method to uniquely identify which mutex should be used | |
# for a resque worker. | |
def redis_key(*args) | |
"lonely_job:#{@queue}" | |
end |