Skip to content

Instantly share code, notes, and snippets.

View EdwardTippett's full-sized avatar

Edward Tippett EdwardTippett

  • Airtasker
  • Sydney
View GitHub Profile
@freshtonic
freshtonic / pre-commit
Last active December 4, 2021 10:33
Git commit hook to abort commits when I accidentally commit dumb shit.
#!/usr/bin/env ruby
# Checks for things that I often commit accidentally and bails out of the
# commit. To skip this pre-commit hook use `git commit --no-verify`.
checks = [
/\bddescribe\b/,
/\biit\b/,
/\bxit\b/,
/binding.pry/,
@pat
pat / gist:6961373
Last active December 25, 2015 10:28
Noting down the basics for file encryption for future reference. Particularly helpful for the next time I need to pass SSL certs around.

Basic encrypting of files to send between people who understand public/private keys.

Encrypting

Generate a random password file. The longer the better (245 characters seems to be the limit for RSA encryption though).

openssl rand 245 > key.file
@tjmcewan
tjmcewan / database.yml
Last active December 24, 2015 13:29
app-agnostic, feature branch supporting, drop-in database.yml(based on http://www.reinteractive.net/posts/22-branch-specific-database-yml)
<%
app_name = Dir.getwd.split('/')[-1]
branch = `git symbolic-ref --short HEAD 2>/dev/null`.chomp.gsub(/\W/, '_')
db_name = branch.match(/feature/) ? "#{app_name}_#{branch}" : "#{app_name}_master"
puts "DATABASE: #{db_name}"
%>
mysql2: &mysql2
adapter: mysql2
socket: /tmp/mysql.sock
#!/usr/bin/env ruby
gem "parser", "~> 1.4"
require "parser"
require "parser/ruby19"
require "set"
require "active_support/all"
class ConstantDeclarationAndUseProcessor < Parser::AST::Processor
attr_reader :declared, :used
@juliocesar
juliocesar / Rakefile
Created August 10, 2012 02:06
Poor man's dev suite
task :run do
rackup = Thread.start { `rackup -p 4567` }
compass = Thread.start { `compass watch --sass-dir sass --css-dir css` }
# ...
at_exit { Thread.kill(rackup) and Thread.kill(compass) }
sleep
end
# In the console, just run:
# $ rake run
@sj26
sj26 / 0-readme.md
Created May 5, 2012 05:39 — forked from burke/0-readme.md
ruby-1.9.3-p194 cumulative performance patch.

Patched ruby 1.9.3-p194 for 30% faster rails boot

What is?

This script installs a patched version of ruby 1.9.3-p194 with patches for boot-time performance improvements (#66 and #68), and runtime performance improvements (#83 and #84). It also includes the new backported GC from ruby-trunk.

Huge thanks to funny-falcon for the performance patches.

@troex
troex / unicorn.sh
Created April 4, 2011 20:57
Unicorn start/stop/restart script for Debian
#!/bin/sh
### BEGIN INIT INFO
# Provides: unicorn
# Required-Start: $local_fs $remote_fs mysql
# Required-Stop: $local_fs $remote_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: unicorn initscript
# Description: Unicorn is an HTTP server for Rack application
### END INIT INFO