Skip to content

Instantly share code, notes, and snippets.

View masukomi's full-sized avatar

masukomi (a.k.a. Kay Rhodes) masukomi

View GitHub Profile
@masukomi
masukomi / .vimrc
Created December 21, 2011 14:36
masukomi's .vimrc
set ww+=<,>
" making arrow keys wrap across line breaks in normal mode
imap <Left> <C-O><Left>
imap <Right> <C-O><Right>
set noexpandtab
set copyindent
set preserveindent
set softtabstop=0
set tabstop=4
@masukomi
masukomi / gist:2344864
Created April 9, 2012 17:27 — forked from panicsteve/gist:1641705
Form letter template for acquired startups
Dear soon-to-be-former user,
We've got some fantastic news! Well, it's great news for us anyway. You, on
the other hand, are fucked.
We've just been acquired by:
[ ] Facebook
[ ] Google
[ ] Twitter
@masukomi
masukomi / markdown_to_bbcode.py
Created July 16, 2012 20:13 — forked from sma/markdown_to_bbcode.py
Converts a subset of markdown into BBcode
import re
def markdown_to_bbcode(s):
links = {}
codes = []
def gather_link(m):
links[m.group(1)]=m.group(2); return ""
def replace_link(m):
return "[url=%s]%s[/url]" % (links[m.group(2) or m.group(1)], m.group(1))
def gather_code(m):
@masukomi
masukomi / octocat_zen.sh
Created November 14, 2012 18:38 — forked from pengwynn/octocat_zen.sh
GitHub Zen
$ curl https://api.github.com/zen | octocatsay
MMM. .MMM
MMMMMMMMMMMMMMMMMMM
MMMMMMMMMMMMMMMMMMM ______________________________
MMMMMMMMMMMMMMMMMMMMM | |
MMMMMMMMMMMMMMMMMMMMMMM | Practicality beats purrrity. |
MMMMMMMMMMMMMMMMMMMMMMMM |_ __________________________|
MMMM::- -:::::::- -::MMMM |/
MM~:~ ~:::::~ ~:~MM

We use a simple shell script like the one below. You'd, obviously, have to tweak it somewhat to tell it about the different file names and decide which box to look for which on but you get the basic idea. In our case we are tailing a file at the same location on multiple boxes. This requires ssh authentication via stored keys instead of typing in passwords.

#!/bin/bash
FILE=$1
for box in box1.foo.com box2.foo.com box3.foo.com box4.foo.com; do
     ssh $box tail -f $FILE &

done

GitHub OAuth Busy Developer's Guide

This is a quick guide to OAuth2 support in GitHub for developers. This is still experimental and could change at any moment. This Gist will serve as a living document until it becomes finalized at Develop.GitHub.com.

OAuth2 is a protocol that lets external apps request authorization to private details in your GitHub account without getting your password. All developers need to register their application before getting started.

Web Application Flow

  • Redirect to this link to request GitHub access:
@masukomi
masukomi / pr.md
Created March 26, 2013 18:20 — forked from piscisaureus/pr.md

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@masukomi
masukomi / bad_dwolla_sig_validator.rb
Created June 1, 2013 18:35
a failed attempt at a method that validates dwolla signatures
# This is a failed attempt to validate the signuature Dwolla passes back with
# a payment as described under *Dwolla's Signature on this page:
# https://developers.dwolla.com/dev/pages/button#configuration
Class Foo
def self.valid_dwolla_signature?(proposed_signature, checkout_id, amount)
require 'base64'
require 'openssl'

Keybase proof

I hereby claim:

  • I am masukomi on github.
  • I am masukomi (https://keybase.io/masukomi) on keybase.
  • I have a public key whose fingerprint is D438 8455 A3D2 5EEF 5BD9 0DDC 906B 307D DE60 0AF9

To claim this, I am signing this object:

<textarea name="my-xml-editor" data-editor="xml" rows="15"></textarea>
...
<textarea name="my-markdown-editor" data-editor="markdown" rows="15"></textarea>
...
<script src="//d1n0x3qji82z53.cloudfront.net/src-min-noconflict/ace.js"></script>
<script>
// Hook up ACE editor to all textareas with data-editor attribute
$(function () {