Skip to content

Instantly share code, notes, and snippets.

View edwindotcom's full-sized avatar
:octocat:
hubba hubba

Edwin Wong edwindotcom

:octocat:
hubba hubba
  • Alameda, CA
View GitHub Profile
#!/usr/bin/python2.7 -S
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
# pip install jws
# pip install python-jose
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
#!/usr/bin/python
#
# usage: python extract_sample.py <url>
import requests
import json
import sys
import time
from pprint import pprint
#!/usr/bin/python
import json
from pprint import pprint
import sys
sys.setrecursionlimit(1500)
def loadJson(json_file):
with open(json_file) as jdata:
data = json.load(jdata)
#!/usr/bin/env ruby
require "webrick"
=begin
WEBrick is a Ruby library that makes it easy to build an HTTP server with Ruby.
It comes with most installations of Ruby by default (it’s part of the standard library),
so you can usually create a basic web/HTTP server with only several lines of code.
The following code creates a generic WEBrick server on the local machine on port 1234,
from bottle import route, run, get, post, request, redirect, static_file
import json
import os
import sys
from os import listdir
from os.path import isfile, join
# if not os.environ.has_key("IMG_ROOT"):
# print 'need IMG_ROOT env set'
### Keybase proof
I hereby claim:
* I am edwindotcom on github.
* I am edwindotcom (https://keybase.io/edwindotcom) on keybase.
* I have a public key ASB7cNwde-yx-Syxd1bYlQIB3jibATDBLhPGuQ0UUHOiiQo
To claim this, I am signing this object:
# usage - run:
# python getTitle.py URL
from urllib2 import urlopen
import sched, time
from time import gmtime, strftime
import lxml.html
import sys
url = sys.argv[1]
git push origin `git subtree split --prefix public master`:gh-pages --force
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
# dependencies
/node_modules
/.pnp
.pnp.js
# testing
/coverage
# Renames all the files in a directory with the root filename
# To run this:
# $ python pymv.py MyFileNameRoot
# > Renaming: Screen Shot 2020-04-23 at 10.07.21 AM.png => flare0.png
import os
import sys
# Function to rename multiple files
def main():