Skip to content

Instantly share code, notes, and snippets.

View kevinburke's full-sized avatar

Kevin Burke kevinburke

View GitHub Profile
@kevinburke
kevinburke / markdown_css.html
Created July 21, 2011 18:59
CSS for a markdown file
<!---
Put this at the top of your markdown file.
-->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<style>
body{
margin: 0 auto;
font-family: Georgia, Palatino, serif;
color: #444444;
line-height: 1;
@kevinburke
kevinburke / chips.hs
Created August 15, 2011 01:04
Chip shuffling program
import Data.List
data Chip = Red | Blue
deriving Show
-- Shuffle two stacks of chips into one. The stack listed first will be on the
-- "bottom"
mergeChip :: [Chip] -> [Chip] -> [Chip]
mergeChip xs [] = xs
mergeChip [] ys = ys
test
@kevinburke
kevinburke / add-phone.clj
Created October 17, 2011 04:51
Help me refactor this Clojure code.
(defn add-phone
"Add a phone number to a given service. There are a few steps we have to take:
- Validate the service name and token
- Validate the phone number
- Send a text message to the number
- Store the number in the database
Arguments:
request - an authorized HTTP request
Returns:
201 Resource Created - phone number added to a service
<?php
/* this is a comment */
$hi;
/* Add these lines to
~/Library/Application\ Support/Google/Chrome/Default/User\ StyleSheets/Custom.css
Other OSes here: http://darcyclarke.me/design/skin-your-chrome-inspector/
*/
#-webkit-web-inspector.platform-mac.platform-mac-snowleopard .monospace,
#-webkit-web-inspector.platform-mac.platform-mac-snowleopard .source-code
{
font-family: Consolas, Monaco, monospace !important;
}
@kevinburke
kevinburke / virtualenv_setup.sh
Created March 12, 2012 01:18
Install virtualenv without easy_install or pip
curl -O http://python-distribute.org/distribute_setup.py && \
python distribute_setup.py && \
easy_install virtualenv
@kevinburke
kevinburke / gist:2322091
Created April 6, 2012 19:01
Most used shell commands
history 1 | awk '{CMD[$2]++;count++;}END { for (a in CMD)print CMD[a] " " CMD[a]/count*100 "% " a;}' | grep -v "./" | column -c3 -s " " -t | sort -nr | nl | head -n20
1 3427 34.2734% git
2 1168 11.6812% ll
3 1164 11.6412% cd
4 791 7.91079% vi
5 578 5.78058% ack
6 299 2.9903% j
7 257 2.57026% cat
8 250 2.50025% python
factory_line = ('{}Factory {}Factory = client.getAccount().get{}Factory();'.format(
list_type, instance_name, list_type))
using System;
using Twilio;
class Example
{
static void Main(string[] args)
{
// Find your Account Sid and Auth Token at twilio.com/user/account
string AccountSid = "AC58f1e8f2b1c6b88ca90a012a4be0c279";
string AuthToken = "456bef";
var twilio = new TwilioRestClient(AccountSid, AuthToken);