An introduction to curl using GitHub's API
Makes a basic GET request to the specifed URI
curl https://api.github.com/users/caspyin
| #!/usr/bin/python | |
| import os.path | |
| import subprocess | |
| import sys | |
| def get_modified_files(): | |
| """ | |
| return a list of modified files tracked by git | |
| """ | |
| git_status = subprocess.Popen(['git', 'status', '-s'], stdout=subprocess.PIPE) |
| function server() { | |
| local port="${1:-8000}" | |
| open "http://localhost:${port}/" | |
| python -m SimpleHTTPServer "$port" | |
| } |
| <?php | |
| function findMax(array $input, $range) { | |
| $curSum = 0; | |
| for($i=0;$i<count($input);$i++) { | |
| $subArr = array_slice($input, $i, $range); | |
| $sum = 0; | |
| foreach($subArr as $arr) { | |
| $sum += $arr; |
| /** | |
| * Gruntfile.js | |
| */ | |
| module.exports = function(grunt) { | |
| grunt.initConfig({ | |
| pkg: grunt.file.readJSON('package.json'), | |
| php: { | |
| dist: { | |
| options: { | |
| port: 8080, |
| #!/usr/bin/python | |
| import subprocess | |
| devs = {} | |
| devs['jayzeng'] = 'jayzeng' | |
| devs['niek'] = 'nieksand' | |
| devs['lee'] = 'leehasoffers' | |
| devs['lucas'] = 'lucasoffers' | |
| devs['josh'] = 'joshs633' | |
| devs['jack'] = 'jackofseattle' |
| #!/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: |
| \l list databases | |
| \d list tables | |
| \d table describe table |
| 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(): |
| 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', '.') |