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
$.getScript('/users/show') | |
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
web: bundle exec rails server puma -p $PORT -e $RACK_ENV | |
critical: env HEROKU_PROCESS=critical bundle exec sidekiq -c 2 -q critical,4 | |
default: env HEROKU_PROCESS=default bundle exec sidekiq -c 4 -q default,2 | |
low: env HEROKU_PROCESS=low bundle exec sidekiq -c 1 -q low,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
# Depth-first search (DFS) is an algorithm for traversing or | |
# searching a tree, tree structure, or graph. One starts at | |
# the root (selecting some node as the root in the graph case) | |
# and explores as far as possible along each branch before backtracking. | |
# | |
# A graph can be represented by its adjacency matrix G, | |
# where G[i][j] == 1 if there is an edge between | |
# vertices i and j and 0 otherwise. | |
# | |
# Below Graph in diagram http://i.imgur.com/sV1UzUn.png |
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
hash = { 'foo' => 'bar' } | |
# Version 1 | |
hash = Hash[hash.map { |k, v| [k.to_sym, v] }] | |
# Version 2 | |
hash = hash.reduce({}) do |memo, (k, v)| | |
memo.tap { |m| m[k.to_sym] = v } | |
end |