[ { "date": "2013-10-28", "count": 8 }, { "date": "2013-10-27", "count": 22 } ] ☁ cat foo.json | jq 'reduce .[].count as $item (0; . + $item)' 30 ☁ seq 10 | jq -s 'reduce .[] as $item (0; . + $item)' 55 http://stedolan.github.io/jq/manual/…
Where dokku is installed? Suppose when user is root, /root/dokku is the place. Docker has lots of regression due to active development, how can I downgrade using with dokku? Change /root/dokku/Makefile. diff --git a/Makefile b/Makefile - a…
"dependencies": { "foo-bar": "*", }, "scripts": { "preinstall": "npm install /path/to/foo-bar", I'd like to Ruby's gem 'foo', path: '/path/to/foo-bar' in node. It works but not sure if there's any way.
If jQuery is included on the page, each view has a $ function that runs queries scoped within the view's element. http://backbonejs.org/#View-dollar @$ is shortcut and preferrable.
foo = 1 new Bar {foo} can be var foo; foo = 1; new Bar({ foo: foo }); res.render 'profile', { user photos csrfToken: req._csrf } can be res.render('profile', { user: user, photos: photos, csrfToken: req._csrf }); refs: http://aseemk.com/ta…
%w(foo bar baz).map(&:to_sym) can be written with %i from Ruby2.0 %i(foo bar baz) http://doc.ruby-lang.org/ja/2.0.0/doc/spec=2fliteral.html %i!STRING! : 要素がシンボルの配列(空白区切り) %I!STRING! : 要素がシンボルの配列(空白区切り)。式展開…
These are Destructuring assignments. someObject = a: 'foo' b: 'bar' { a, b } = someObject console.log a # -> 'foo' console.log b # -> 'bar' class Foo constructor: (a) -> @a = a class Foo constructor: (@a) -> # is equivalant to above class …
Good way to use nfs or not, this is from discourse's Vagrantfile nfs_setting = RUBY_PLATFORM =~ /darwin/ || RUBY_PLATFORM =~ /linux/ config.vm.synced_folder ".", "/vagrant", id: "vagrant-root", :nfs => nfs_setting
In our company (paperboy&co.), we have lots of workshops or semminars everyday. One of them is "Association to the interpretation in English with everyone". It's held during lunch time. First we pronounce, and translate the given part. The…
even = ->(x) { (x % 2) == 0 } # we can use Proc#call even.call(2) even.call(3) # also available to use ===, instead of using Proc#call even === 2 even === 3 # we can use === in case statement as well. fizzbuzz = ->(x) { (x % 3) == 0 && (x …
I love znc, A irc bouncer. Today, i introduce znc to younger colleague. Then i realized i was wrong to configure of znc. When we $ znc --makeconf, it generates .znc/configs/znc.conf. It's something like this. <User freenode> Pass = sha256#foobarfoobarfoo</user>…
1, install capistrano-lazy-assets in webistrano environment. 2, add recipe at webistrano load 'deploy/assets' require 'capistrano-lazy-assets' 3, deploy_via by remote_cache deploy_via :remote_cache repository_cache cached-copy That's it. i…
fluent-plugin-filter_keys has been released. https://github.com/banyan/fluent-plugin-filter_keys Some of the plugin assumes the key is always exists, so this plugin help to check if the given key is exists in the event log. <match test.**> type filter_ke</match>…
Coursera https://www.coursera.org/ EDX https://www.edx.org/ udacity https://www.udacity.com/ khanacademy https://www.khanacademy.org/
options = { transform: -> s {"<#{s}>"}, upcase: true } filters = [] if options[:upcase] filters << -> string { string.upcase } end if options[:transform] filters << options[:transform] # callback function end results = %w(foo bar) filters.…
I'm using rails3_acts_as_paranoid with current project. gem 'rails3_acts_as_paranoid' I couldn't update to rails4.0.0.beta1 because of the problem of dependency, so I checked repo of rails3_acts_as_paranoid. then I found this PR, I asked r…
$ git clone [url] $ git co -b feature $ hub fork $ pr # function for zsh function pr { git push -u $GITHUB_USER `git rev-parse --abbrev-ref HEAD` url=`hub pull-request` open $url } confirm if current repo is already forked. $ git remote ba…
dependency API が解決できずに無限ループに入ってしまうことがある https://github.com/carlhuda/bundler/issues/1450 $ DEBUG_RESOLVER=1 bundle update --verbose |& tee bundle.log こんな感じで実行して無限ループに入ることを確認できる。 で、Gemfile…
chrome extention こういうのあって不毛感ある https://code.google.com/p/chromium/issues/detail?id=88841
https://github.com/lostisland/faraday/commit/ac1b537f49bf110e87fe50679d80764367fb2d13 README.md に Travis のバッチ貼って誰が気にするの?視覚的にも汚いし、オフラインで README 読むときに意味ないよね? Being a developer, I prefer not to rely …
znc --makepass で generate して、config に上書き znc の server の後ろのパスワードも変更 (Server = hogehoge.co.jp +6668 foobar) irc client のパスワードも変更 znc 再起動
rails 環境に依存しない時は spec_helper_lite.rb みたいなのを使うといいと聞いた。
irb(main):008:0> template = %{ say "It works!" } => " say \"It works!\" " irb(main):009:0> template.instance_eval "def read; self; end" => nil irb(main):010:0> template.read => " say \"It works!\" "