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
// Note: make sure your editor in step 2 is non-blocking (i.e. not "subl -w") | |
// | |
// 1. Enable in your config/environment/development.rb | |
// config.action_view.annotate_rendered_view_with_filenames = true | |
// | |
// 2. Add this to your routes.rb | |
// post "__xray/open", to: ->(env) { | |
// editor = ENV["GEM_EDITOR"] || ENV["VISUAL"] || ENV["EDITOR"] || "/usr/local/bin/subl" | |
// params = JSON.parse(Rack::Request.new(env).body.read) | |
// path = Rails.root.join(params["path"].to_s) |
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
# add source | |
cat >> /etc/apt/sources.list <<EOF | |
# Nginx | |
deb http://nginx.org/packages/ubuntu/ disco nginx | |
deb-src http://nginx.org/packages/ubuntu/ disco nginx | |
EOF | |
# add signing key | |
curl http://nginx.org/packages/keys/nginx_signing.key | sudo apt-key add - |
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
#!/bin/bash | |
# Install: | |
# curl -O https://gist.githubusercontent.com/2called-chaos/4285767/raw/setup-autossh-tunnel.sh | |
# chmod u+x setup-autossh-tunnel.sh | |
# ./setup-autossh-tunnel.sh | |
SSH_USER="mysql_tunnel" | |
SSH_SERVER="db.example.net" | |
SSH_PORT="22" |
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
################################## | |
### SCROLL DOWN FOR AN EXAMPLE ### | |
################################## | |
module Enumerable | |
# your each_with_position method | |
def each_pos &block | |
EachWithPosition.each(self, &block) | |
end | |
end |