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
// 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> |
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
# 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 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 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 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 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 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 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
RSpec::Matchers.define(:be_same_file_as) do |exected_file_path| | |
match do |actual_file_path| | |
expect(md5_hash(actual_file_path)).to eq(md5_hash(expected_file_path)) | |
end | |
def md5_hash(file_path) | |
Digest::MD5.hexdigest(File.read(file_path)) | |
end | |
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
;;; pbcopy.el --- Emacs Interface to pbcopy | |
;; Copyright (C) 2011 Daniel Nelson, based on xclip.el, by Leo Shidai Liu | |
;; This file is free software; you can redistribute it and/or modify | |
;; it under the terms of the GNU General Public License as published by | |
;; the Free Software Foundation; either version 3, or (at your option) | |
;; any later version. | |
;; This file is distributed in the hope that it will be useful, |
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
# vim:se filetype=ruby | |
# vim:se foldlevel=3 | |
# | |
# Hacks and monkeys to run Symfony 1.4 applications as Rack apps using | |
# the rack-legacy and rack-rewrite gems. | |
# | |
# A couple of rack-rewrite rules take care of handing requests to the | |
# default front controller (index.php) and a subclass of rack-legacy's | |
# Php fixes PATH_INFO for Symfony routing. | |
# |
OlderNewer