Skip to content

Instantly share code, notes, and snippets.

View neilang's full-sized avatar
😎
Just being a cool guy

Neil Ang neilang

😎
Just being a cool guy
View GitHub Profile
@bmhatfield
bmhatfield / .profile
Last active June 18, 2024 09:38
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
@pithyless
pithyless / char_converter.rb
Created September 5, 2012 16:00
Rails middleware to encode characters and avoid exploding controllers
# config/initializers/char_converter.rb
require 'uri'
module Support
class CharConverter
SANITIZE_ENV_KEYS = [
"HTTP_COOKIE", # bad cookie encodings kill rack: https://github.com/rack/rack/issues/225
"HTTP_REFERER",
"PATH_INFO",
@neilang
neilang / NASpinSegue.m
Created December 4, 2011 04:52
Spin Segue using CABasicAnimation
#import "NASpinSegue.h"
#import <QuartzCore/QuartzCore.h>
#define SPINS 3.0f
#define DURATION 0.5f
#define TRANSITION_OUT_KEY @"transition out"
#define TRANSITION_IN_KEY @"transition in"
#define TRANSITION_IDENT @"transition type"
@implementation NASpinSegue
@neilang
neilang / git config
Created July 20, 2011 06:08
Add git plush command
[alias]
plush = "!sh -c 'git pull --rebase && git push'"