Skip to content

Instantly share code, notes, and snippets.

View rsrchboy's full-sized avatar

Chris Weyl rsrchboy

View GitHub Profile
@technoweenie
technoweenie / github_oauth_busy_developer_guide.md
Created May 30, 2010 18:34
GitHub OAuth Busy Developer's Guide

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:
@diogok
diogok / proxy.lua
Created April 15, 2011 17:09
Simple HTTP reverse proxy in Lua
#!/usr/bin/env lua
require 'socket'
require 'copas'
assert(arg[1],"Must pass host and port to listen")
assert(arg[2],"Must pass host and port to proxy")
local config = {
newhost=string.gsub(arg[1],"([^:]+):(%d+)","%1"),
newport=string.gsub(arg[1],"([^:]+):(%d+)","%2"),
@mlafeldt
mlafeldt / tapVerboseOutput.vim
Created April 20, 2011 20:16
Vim syntax file for TAP output
" Vim syntax file
" Language: Verbose TAP Output
" Maintainer: Rufus Cable <rufus@threebytesfull.com>
" Remark: Simple syntax highlighting for TAP output
" License:
" Copyright (c) 2008 Rufus Cable
if exists("b:current_syntax")
finish
endif
@mfontani
mfontani / log-deployment.txt
Created April 29, 2011 23:06
Deploying a dancer webapp to DotCloud.com
Dancing on the cloud
okram@BLUEDESK ~> sudo aptitude install python-setuptools
[...]
okram@BLUEDESK ~> sudo easy_install dotcloud
[...]
okram@BLUEDESK ~> dotcloud
Warning: /home/okram/.dotcloud/dotcloud.conf does not exist.
#cloud-config
apt_update: false
apt_upgrade: true
packages:
- pwgen
- pastebinit
- byobu
- build-essential
- bison
@sjl
sjl / markdown.vim
Created June 21, 2011 19:47 — forked from vim-voom/markdown.vim
Markdown folding for Vim
" folding for Markdown headers, both styles (atx- and setex-)
" http://daringfireball.net/projects/markdown/syntax#header
"
" this code can be placed in file
" $HOME/.vim/after/ftplugin/markdown.vim
func! Foldexpr_markdown(lnum)
let l1 = getline(a:lnum)
if l1 =~ '^\s*$'
@simonw
simonw / log.lua
Created June 22, 2011 09:28
Query logging for mysql-proxy
--[[
Copyright (C) 2007 MySQL AB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@rwstauner
rwstauner / perl-syntax-sql.vim
Created June 22, 2011 15:01
highlight SQL syntax in a Perl heredoc
" ~/.vim/after/syntax/perl.vim
let s:bcs = b:current_syntax
unlet b:current_syntax
syntax include @SQL syntax/sql.vim
let b:current_syntax = s:bcs
" match optional, surrounding single or double quote and any whitespace in the heredoc name
syntax region perlHereDocSQL matchgroup=Statement start=+<<\(['"]\?\)\z(\s*SQL\s*\)\1+ end=+^\z1$+ contains=@SQL
@cdown
cdown / gist:1163649
Last active April 9, 2024 01:10
Bash urlencode and urldecode
urlencode() {
# urlencode <string>
old_lc_collate=$LC_COLLATE
LC_COLLATE=C
local length="${#1}"
for (( i = 0; i < length; i++ )); do
local c="${1:$i:1}"
case $c in
@potch
potch / gist_line_numbers.css
Created September 26, 2011 18:53
CSS to add line numbers to embedded gists
.gist-highlight {
border-left: 3ex solid #eee;
position: relative;
}
.gist-highlight pre {
counter-reset: linenumbers;
}
.gist-highlight pre div:before {