Skip to content

Instantly share code, notes, and snippets.

column_pairs = [
# datatype, expected, given
("string", "fax","Fax"),
("string", "email", "Email"),
("string", "company_name","Company"),
("string", "company_street_address", "Company Address"),
("string", "company_street_addres_2","Company Address 2"),
("string", "company_city", "Company City"),
("string", "company_state", "Company State"),
("string", "company_zip", "Company Zip"),
@beng
beng / mixcloud-downloader.py
Last active March 16, 2018 16:23
find the URL required to download a song from mixcloud
"""
Download songs from mixcloud
Usage: python mixcloud-downloader.py <url to song>
Example (download a single song):
$ python mixcloud-downloader.py https://www.mixcloud.com/gridface/756-farleydave03-wbmx-chicago-1984-85/
Advanced example (download multiple songs):
@beng
beng / elastic-ingest.sh
Last active April 28, 2016 16:46
fast elastic writes from @adkatrit (github.com/adkatrit)
#!/bin/bash
# fast elastic writes from @adkatrit (http://github.com/adkatrit)
INDEX=$1
ES_SOCKET=$2
#Create index
curl -XPUT "$ES_SOCKET/$INDEX/"
@beng
beng / worst-javascript-joke.md
Last active March 14, 2016 18:59
worst javascript joke ever made. credit goes to jeff knupp (https://jeffknupp.com/)

worst javascript joke ever made. credit goes to jeff knupp

> Manager: Hey developer! Our front end is all messed up! People are seeing each other’s account information!
> Employee: Really? Let me just check the CoffeeScript files
> Manager: Too late! The police are here!
> Police Officer: OK, does someone want to let me know want transpiled here?
@beng
beng / try.sh
Last active February 9, 2016 15:40
Credit for this script goes to Isaac (.ike) Levy ike@blackskyresearch.net
#############################################################################
# Credit for this script goes to Isaac (.ike) Levy ike@blackskyresearch.net #
#############################################################################
#!/bin/sh
yell() { echo "$0: $*" >&2; }
die() { yell "$*"; exit 111; }
try() { "$@" || die "cannot $*"; }
@beng
beng / oregon.bas
Created November 24, 2015 23:04 — forked from fogus/oregon.bas
1975 version of Oregon Trail
8 REM MINNESOTA EDUCATIONAL COMPUTING CONSORTIUM STAFF
9 REM PROGRAMMING REVISIONS BY DON RAWITSCH - 1975
11 REM CURRENT VERSION - 3/27/75
15 REM **FOR THE MEANING OF THE VARIABLES USED, LIST LINES 4900-4960**
25 PRINT "DO YOU NEED INSTRUCTIONS (YES/NO)";
30 DIM C$[5]
35 INPUT C$
40 IF C$="NO" THEN 400
45 PRINT LIN(2)
59 REM ***INSTRUCTIONS***
@beng
beng / impbcopy.m
Last active September 4, 2018 07:03 — forked from kenkeiter/impbcopy.m
/////////////////////////////////////////////////////////
// Copied from http://www.alecjacobson.com/weblog/?p=3816
/////////////////////////////////////////////////////////
#import <Foundation/Foundation.h>
#import <Cocoa/Cocoa.h>
#import <unistd.h>
BOOL copy_to_clipboard(NSString *path)
{
// http://stackoverflow.com/questions/2681630/how-to-read-png-image-to-nsimage
NSImage * image;
@beng
beng / reconfigure-keyboard.sh
Created January 20, 2015 16:27
command to reconfigure your keyboard in ubuntu server
sudo dpkg-reconfigure keyboard-configuration
@beng
beng / solution.py
Last active November 5, 2015 15:13 — forked from isa/gist:2571012
Question: Convert following into the latter data structure in less than 30 lines:
List:
A, B, C
A, C, E
E, F, D
D, A, J
E, D, J
List
@beng
beng / apt-get-history.sh
Created December 2, 2014 21:03
A way to find all the stuff you manually installed on ubuntu via apt-get as found here: http://askubuntu.com/a/250530
(zcat $( ls -tr /var/log/apt/history.log*.gz ) ; cat /var/log/apt/history.log ) | egrep '^(Start-Date:|Commandline:)' | grep -v aptdaemon | egrep '^Commandline:'