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
| GC.disable | |
| objects = ObjectSpace.count_objects | |
| start = objects[:TOTAL] | |
| puts "objects: #{start}" # => 9811 | |
| 1_000_000.times do | |
| "I am a lonly" + " concatenated" + " string" + "." | |
| end | |
| end_objects = ObjectSpace.count_objects(objects)[:TOTAL] | |
| puts "objects: #{end_objects}" | |
| puts "difference: #{end_objects - start}" |
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
| (defun ruby-send-region (start end) | |
| "Send the current region to the inferior Ruby process." | |
| (interactive "r") | |
| (let (term (file (buffer-file-name)) line) | |
| (save-excursion | |
| (save-restriction | |
| (widen) | |
| (goto-char start) | |
| (setq line (+ start (forward-line (- start)) 1)) | |
| (goto-char start) |
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 'sj' | |
| run SinatraJekyll |
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
| set-window-option -g mode-keys emacs | |
| set-window-option -g window-status-current-bg red | |
| set-window-option -g window-status-current-fg white | |
| set-window-option -g window-status-current-attr 'bold' | |
| set-window-option -g window-status-current-attr 'bold' | |
| set-window-option -g window-status-fg black | |
| set-window-option -g window-status-bg white | |
| set-window-option -g automatic-rename on | |
| set-window-option -g utf8 on |
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
| # ....other stuff here | |
| paginate: 10 |
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
| # unicorn_rails -c /data/github/current/config/unicorn.rb -E production -D | |
| rails_env = ENV['RAILS_ENV'] || 'production' | |
| # 16 workers and 1 master | |
| worker_processes (rails_env == 'production' ? 16 : 4) | |
| # Load rails+github.git into the master before forking workers | |
| # for super-fast worker spawn times | |
| preload_app 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
| // TODO: remove spaces and newlines | |
| javascript:(function(){ | |
| s=document.createElement('script'); | |
| s.type='text/javascript'; | |
| s.src='http://example.com/bookmarklet.js'; | |
| document.body.appendChild(s); | |
| })(); | |
| // TODO: bookmarklet code needs to be in an anchor tag | |
| // <a href="javascript:(function(){s=document.createElement('script');s.type='text/javascript';s.src='http://example.com/bookmarklet.js';document.body.appendChild(s);})();">My Bookmarklet</a> |
NewerOlder