Skip to content

Instantly share code, notes, and snippets.

@jayzeng
jayzeng / shift.js
Created March 19, 2014 20:27
left shifting
function shift(input, pos) {
return input.slice(pos, input.length) + input.slice(0, pos);
}
console.log(shift("abcdefg", 2) === "cdefgab");
//ImageView angryHuskyImageView = (ImageView)findViewById(R.id.imageView);
//angryHuskyImageView.setTag("http://d24w6bsrhbeh9d.cloudfront.net/photo/a2zQDvw_700b.jpg");
Your YC username:
Company name:
Company url, if any:
Phone number(s):
Please enter the url of a 1 minute unlisted (not private) YouTube video introducing the founders. (Instructions.)
YC usernames of all founders, including you, e1ven, separated by spaces. (That's usernames, not given names: "bksmith," not "Bob Smith." If there are 3 founders, there should be 3 tokens in this answer.)
YC usernames of all founders, including you, e1ven, who will live in the Bay Area January through March if we fund you. (Again, that's usernames, not given names.)
What is your company going to make?
If this application is a response to a YC RFS, which one?
For each founder, please list: YC username; name; age; year of graduation, school, degree and subject for each degree; email address; personal url, github url, facebook id, twitter id; employer and title (if any) at last job before this startup. Put unfinished degrees in parens. List the main contact first. Separate founders with blank lines. Put an asterisk before t
@jayzeng
jayzeng / twilio.xml
Created August 11, 2013 03:39
twilio
<?xml version="1.0" encoding="UTF-8"?><Response><Say>Welcome to twilio!</Say></Response>
@jayzeng
jayzeng / download_bench.py
Created August 1, 2013 00:58
various ways to download a file, compare their time
import urllib2
import httplib
import os
import time
from urllib2 import Request, urlopen, URLError
def save_file(file):
output_filename = file.split("/")[-1]
if os.path.exists(output_filename):
@jayzeng
jayzeng / find.py
Created July 31, 2013 23:07
find files per pattern
import os
import fnmatch
def gen_find(filepath, loc):
for path, diralist, filelist in os.walk(loc):
for name in fnmatch.filter(filelist, filepath):
yield os.path.join(path, name)
pyfiles = gen_find('*.py', '.')
@jayzeng
jayzeng / get_sample.py
Created July 30, 2013 20:47
down load sample
import os
import logging
import argparse
from boto.s3.connection import S3Connection
def create_dir(type):
if not os.path.exists(type):
os.mkdir(type)
def get_aws_credentials():
@jayzeng
jayzeng / psql
Last active December 19, 2015 16:58
psql cheat sheet
\l list databases
\d list tables
\d table describe table
@jayzeng
jayzeng / list_repo.py
Created July 9, 2013 19:23
list repo
#!/usr/bin/env python
from github3 import login
def list_branches(token, target_repo):
github_login = login(token=token)
repos = github_login.iter_repos()
for r in repos:
if r.name == target_repo:
@jayzeng
jayzeng / mat_remote
Last active December 19, 2015 13:09
mat remote
#!/usr/bin/python
import subprocess
devs = {}
devs['jayzeng'] = 'jayzeng'
devs['niek'] = 'nieksand'
devs['lee'] = 'leehasoffers'
devs['lucas'] = 'lucasoffers'
devs['josh'] = 'joshs633'
devs['jack'] = 'jackofseattle'