Skip to content

Instantly share code, notes, and snippets.

@sindresorhus
sindresorhus / .profile
Created April 6, 2016 11:10 — forked from bmhatfield/.profile
Automatic Git commit signing with GPG on OSX
# In order for gpg to find gpg-agent, gpg-agent must be running, and there must be an env
# variable pointing GPG to the gpg-agent socket. This little script, which must be sourced
# in your shell's init script (ie, .bash_profile, .zshrc, whatever), will either start
# gpg-agent or set up the GPG_AGENT_INFO variable if it's already running.
# Add the following to your shell init to set up gpg-agent automatically for every shell
if [ -f ~/.gnupg/.gpg-agent-info ] && [ -n "$(pgrep gpg-agent)" ]; then
source ~/.gnupg/.gpg-agent-info
export GPG_AGENT_INFO
else
@threedaymonk
threedaymonk / .gitignore
Last active January 3, 2016 22:29
Little Schemer group, chapter 1
*.pdf
*.dot
#!/usr/bin/env bash
function p() {
PROJECT_PATH=~/Sites
results=(`find $PROJECT_PATH -type d -maxdepth 3 -iname "*$1*"`)
count=${#results[@]}
if [ $count -gt 1 ]; then
echo ""
@gma
gma / insane-magic.spec
Last active September 13, 2022 17:18
What's so bad about RSpec?
require 'rspec'
describe 'Rspec' do
it 'should not allow you to make shit up' do
[1, 2, 3].should have(4).potatoes
end
end
@caike
caike / Riffle.js
Created March 27, 2011 14:53
encapsulation
function Rifle(rounds) {
var _rounds = rounds
, _reloadingMechanism;
function _setRound(roundNumber){
_rounds = roundNumber;
}
@jgwhite
jgwhite / Pre-flight
Created December 1, 2010 16:56
Pre-flight QA Checklist
- airbrake
- newrelic
- todos
- robots.txt
- favicon
- apple-touch-icon
- caching
- meta description
- title
- browser compatibility
#!/bin/bash
# WEB SERVER
sudo apt-get update
sudo apt-get install nginx
# APPS FROM SOURCE
cd /usr/local/src/
# PHP (w/FPM for NGINX)