Skip to content

Instantly share code, notes, and snippets.

//Heavily edited by myself. Originally from https://gist.github.com/238834/e2d0a6ca427fdf02d55ced1fdfb8ed37b2cd8a62
(function(){
plugin.onMessageInsertion = function(event){
var lastRow = Talker.getLastRow();
if (!lastRow.length) return;
var lastP = lastRow.find('div.line');
if (!lastP.length) return;
if (lastP.find('iframe.talkerapp-plugin-gist-embed').length) return;
var gistLink = lastP.find('a[href^=https://gist.github.com]:first');
########################################################################
### Rakefile for encrypted passwords
########################################################################
#
# Here's a little Rakefile to manage your encrypted password file! It's
# really easy to use:
#
# 1) put the email addresses of the keys you want in AUTHORIZED_USERS
# 2) create a passwords.txt (and ignore it in your SCM)
# 3) run `rake passwords:encrypt`
@saimonmoore
saimonmoore / Guardfile
Created February 4, 2011 13:08
saimonmoore's guardfile
# A sample Guardfile
# More info at http://github.com/guard/guard#readme
guard 'livereload', :api_version => '1.5' do
watch(%r{app/.+\.(rb|erb|haml|js|sass)$})
watch(%r{app/helpers/.+\.rb$})
watch(%r{public/.+\.(sass|css|js|html)$})
watch(%r{config/locales/.+\.yml$})
end
$$('form input[name=authenticity_token]').select(function(i) {return i.value != $$('meta[name=csrf-token]')[0].readAttribute('content');}).map(function(i) {var form = i.up('form'); form.setStyle({border: '2px solid red'}); return form;});
Capybara::Driver::Selenium.class_eval do
class << self
alias old_driver driver
if false
# override firefox driver in favor of selenium
def driver
@driver ||= begin
driver = Selenium::WebDriver.for :chrome
at_exit { driver.quit }
driver
#############################################
$ nginx -V
nginx version: nginx/0.8.53
TLS SNI support enabled
configure arguments: --prefix=/usr/local/Cellar/nginx/0.8.53 --with-http_ssl_module --with-pcre --conf-path=/usr/local/etc/nginx/nginx.conf --pid-path=/usr/local/var/run/nginx.pid --lock-path=/usr/local/var/nginx/nginx.lock
#############################################
$ sudo lsof -Pni -a -c nginx
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
nginx 8509 root 9u IPv4 0x08bfd6b0 0t0 TCP *:8080 (LISTEN)
from:
object.log {
puts
}
to:
object.log { puts }
@saimonmoore
saimonmoore / core_helper.rb
Created September 20, 2010 12:46 — forked from ice799/core_helper.rb
CoreHelper - lots of info before core dumps
#!/custom/ree/bin/ruby
# USAGE:
#
# echo "|/path/to/core_helper.rb %p %s %u %g" > /proc/sys/kernel/core_pattern
#
require 'etc'
require 'net/smtp'
#
stty erase
# Setting the path for MacPorts.
export PATH=/opt/local/bin:/opt/local/sbin:/opt/usr/bin:$PATH
# export PATH=/opt/local/lib/postgresql82/bin:/opt/local/lib/mysql5/bin:/WebKit/WebKitTools/Scripts:$PATH
export PATH=~/Development/bin:$PATH
export PATH=$PATH:"/Library/Application Support/VMware Fusion/"
# export PATH=$PATH:"/opt/android-sdk-mac_x86-1.5_r2/tools"
export PATH=$PATH:"/opt/PalmSDK/Current/bin"
@saimonmoore
saimonmoore / 0_notes.txt
Created June 18, 2010 20:44 — forked from wayneeseguin/0_notes.txt
rvmrc + bundler
This is an example of using RVM's Project .rvmrc file
to have it automatically bootstrap your environment, including bundler.
This could be further expanded to do anything you require :)
The important thing to remember is that the purpose of these files is
to allow you to very easily have your 'project context' (aka 'environment')
loaded automatically for you when you enter the project in the shell (cd).
You can generate the .rvmrc file below by running: