Skip to content

Instantly share code, notes, and snippets.

View ryaninvents's full-sized avatar

Ryan Kennedy ryaninvents

View GitHub Profile
@friggeri
friggeri / haiku
Created October 6, 2011 07:30
random heroku-like name generator
haiku = ->
adjs = [
"autumn", "hidden", "bitter", "misty", "silent", "empty", "dry", "dark",
"summer", "icy", "delicate", "quiet", "white", "cool", "spring", "winter",
"patient", "twilight", "dawn", "crimson", "wispy", "weathered", "blue",
"billowing", "broken", "cold", "damp", "falling", "frosty", "green",
"long", "late", "lingering", "bold", "little", "morning", "muddy", "old",
"red", "rough", "still", "small", "sparkling", "throbbing", "shy",
"wandering", "withered", "wild", "black", "young", "holy", "solitary",
"fragrant", "aged", "snowy", "proud", "floral", "restless", "divine",
@kyleturner
kyleturner / Remove Submodule
Created January 5, 2012 01:07
How to remove a submodule from a Github project
To remove a submodule you need to:
Delete the relevant line from the .gitmodules file.
Delete the relevant section from .git/config.
Run git rm --cached path_to_submodule (no trailing slash).
Commit and delete the now untracked submodule files.
@qzchenwl
qzchenwl / OAuth2.hs
Created April 10, 2012 12:34
Simple oauth2.0 implementation in Haskell
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE DeriveDataTypeable #-}
import Data.Aeson
import qualified Data.ByteString.Char8 as BS
import qualified Data.ByteString.Lazy.Char8 as BSL
import Data.ByteString.Lazy (toChunks)
import Data.List
import Data.Maybe
import Data.Typeable (Typeable)
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active July 16, 2024 16:59
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@indragiek
indragiek / main.c
Created November 29, 2012 01:10
Simple key logger for OS X using CGEventTap
// Super simple key logger that uses a CGEventTap to log
// the unicode strings for each key down event
// Doesn't handle special keys (enter, backspace, etc.)
#include <stdio.h>
#import <Carbon/Carbon.h>
#import <ApplicationServices/ApplicationServices.h>
CGEventRef loggerCallback(CGEventTapProxy proxy, CGEventType type, CGEventRef event, void* context)
{
@g-k
g-k / gpg-git-smudge-clean.md
Last active June 22, 2022 07:16
test transparent git encryption with smudge clean filters using gpg

Generate a GPG Key and revocation cert per http://www.gnupg.org/gpg/en/manual.html:

gpg --key-gen
gpg --output revoke.asc --gen-revoke <my user ID or email>

Once gpg key in keyring we can encrypt and decrypt files.

#!/bin/bash
# Wrapper script for git mergetool
# This requires the .gitconfig file to have:
# - mergetool entry for "wdiff";
# - mergetool entry for "fw_def";
# These merge tool entries must both specify the
# cmd field. The command to call this script:
# [mergetool "merge_wrapper"]
# cmd = $HOME/merge-wrapper \"$BASE\" \"$LOCAL\" \"$REMOTE\" \"$MERGED\"
# Locate this script in your $HOME
@paulirish
paulirish / bling.js
Last active July 3, 2024 20:45
bling dot js
/* bling.js */
window.$ = document.querySelectorAll.bind(document);
Node.prototype.on = window.on = function (name, fn) {
this.addEventListener(name, fn);
}
NodeList.prototype.__proto__ = Array.prototype;
@maximilianschmitt
maximilianschmitt / readme.md
Last active August 29, 2015 14:19
Making your io.js command line apps compatible with node.js
@ryaninvents
ryaninvents / fix-npm.sh
Last active March 26, 2016 16:33
Fix npm global install
# This script is the **correct** way to allow installation and use
# of npm executables without sudo.
# Declare where you want your global packages installed to.
npm config set prefix '~/.local/share/npm'
# Ensure the directory exists.
mkdir -p ~/.local/share/npm
# Change `.zshrc` to `.bashrc` if appropriate, but consider instead