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
-- dbext:type=PGSQL:user=yangchenyun:dbname=huali_development:host=localhost:port=5432 | |
select source, count(id) | |
from orders | |
group by source | |
; | |
select name_zh, sum(quantity) | |
from products, line_items | |
where products.id = line_items.product_id |
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
[1, 2, 3].each do |n1| | |
if n1 == 1 | |
[1, 2, 3].each do |n2| | |
if n2 == 2 | |
[1, 2, 3].each do |n3| | |
if n3 == 3 | |
[1, 2, 3].each do |n4| | |
if n4 == 4 | |
print n1, n2, n3, n4 | |
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
################ | |
# Properties | |
################ | |
# | |
# color | |
# red, green, ivory, blue. yellow | |
# nationality | |
# englishman, spaniard, ukrainian, norwegian, japanese |
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
# mode 0: old style sleep / 3: new (save to disk style) | |
# show the hibernatemode | |
pmset -g | grep hibernatemode | |
# change the hibernate mode | |
sudo pmset -a hibernatemode 0 | |
# check the sleepimage size | |
ls -lh /private/var/vm/sleepimage |
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
{ | |
:method => :post, | |
:body => { | |
"success" => true | |
}, | |
:url => #<URI::HTTPS:0x007f9331a165f0 URL:https://api.segment.io/v1/import>, | |
:request_headers => { | |
"Accept" => "application/json", | |
"Content-Type" => "application/json" | |
}, |
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
This file contains any messages produced by compilers while | |
running configure, to aid debugging if configure makes a mistake. | |
It was created by GNU Smalltalk configure 3.2.5, which was | |
generated by GNU Autoconf 2.69. Invocation command line was | |
$ ./configure --disable-debug --disable-dependency-tracking --prefix=/usr/local/Cellar/gnu-smalltalk/3.2.5 --disable-gtk --with-readline=/usr/local/Cellar/readline/6.2.4/lib --without-tcl --without-tk --without-x | |
## --------- ## | |
## Platform. ## |
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
2013-06-21T03:56:38Z 15961 TID-1104yk Sidekiq::Extensions::DelayedClass JID-64cafe9d2209c90b8563b3dc DEBUG: Failure! Retry 0 in 36 seconds | |
2013-06-21T03:56:38Z 15961 TID-1104yk Sidekiq::Extensions::DelayedClass JID-64cafe9d2209c90b8563b3dc INFO: fail: 4.292 sec | |
2013-06-21T03:56:38Z 15961 TID-1104yk WARN: {"retry"=>true, "queue"=>"default", "class"=>"Sidekiq::Extensions::DelayedClass", "args"=>["---\n- !ruby/class 'AnalyticWorker'\n- :complete_order\n- - 1317\n"], "jid"=>"64cafe9d2209c90b8563b3dc", "enqueued_at"=>1371786994.4752176, "error_message"=>"-1: Connection error: execution expired", "error_class"=>"RuntimeError", "failed_at"=>2013-06-21 03:56:38 UTC, "retry_count"=>0} | |
2013-06-21T03:56:38Z 15961 TID-1104yk WARN: -1: Connection error: execution expired | |
2013-06-21T03:56:38Z 15961 TID-1104yk WARN: /home/deployer/repositories/huali-production/releases/20130620044646/app/workers/analytic_worker.rb:209:in `send_request' | |
/home/deployer/repositories/huali-production/releases/20130620044646/app/workers/analytic |
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
startup, version: 2217 osx x64 channel: stable | |
executable: /Applications/Sublime Text 2.app/Contents/MacOS/Sublime Text 2 | |
working dir: / | |
packages path: /Users/yangchenyun/Library/Application Support/Sublime Text 2/Packages | |
settings path: /Users/yangchenyun/Library/Application Support/Sublime Text 2/Settings | |
PackageSetup not required | |
catalogue loaded | |
found 29 files for base name Default.sublime-keymap | |
found 3 files for base name Default.sublime-mousemap | |
found 45 files for base name Main.sublime-menu |
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
str = 'raise StandardError' | |
l = -> { raise StandardError } | |
def eval_call(str) | |
eval(str) | |
end | |
def lambda_call(l) | |
l.call | |
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
require 'active_model' | |
class Person | |
# Required dependency for ActiveModel::Errors | |
extend ActiveModel::Naming | |
def initialize | |
@errors = ActiveModel::Errors.new(self) | |
end |