Skip to content

Instantly share code, notes, and snippets.

View henrysher's full-sized avatar
💭
I may be slow to respond.

Henry Huang henrysher

💭
I may be slow to respond.
View GitHub Profile
@henrysher
henrysher / list.txt
Created March 31, 2020 01:09 — forked from shortjared/list.txt
List of AWS Service Principals
acm.amazonaws.com
alexa-appkit.amazon.com
apigateway.amazonaws.com
application-autoscaling.amazonaws.com
appstream.application-autoscaling.amazonaws.com
appsync.amazonaws.com
athena.amazonaws.com
autoscaling.amazonaws.com
batch.amazonaws.com
channels.lex.amazonaws.com
@henrysher
henrysher / TwentyBot
Last active August 29, 2015 14:21 — forked from CodyWalker/TwentyBot
function countPieces() {
it = b.pieces();
var i = 0;
while (it.current()){ i++; it.next() }
return i;
}
function getRandPiece() {
var it = b.pieces();
var n = Math.floor(Math.random()*countPieces());
@henrysher
henrysher / 0_reuse_code.js
Created July 23, 2014 04:23
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
tutorials = [('Mining Social Web APIs with IPython Notebook', 'Novice'),
('A hands-on introduction to Python for beginning programmers', 'Novice'),
('How to formulate a (science) problem and analyze it using Python code', 'Novice'),
('0 to 00111100 with web2py', 'Novice'),
('Getting Started with Django, a crash course', 'Novice'),
('Django for Web Designers and Front End Developers ', 'Novice'),
('Python 3/2 Web Development with Pyramid', 'Novice'),
('Introduction to game programming', 'Novice'),
('Hands-on Beginning Python', 'Novice'),
('TDD for web applications, from scratch', 'Novice'),
<local>,0.0.0.0/0,*.dev,*bj*.*,*51*.*,*91*.*,*ali*.*,*.cn*.*,*.cn,*china*.*,*0-6.com,*000dn.com,*000wan.com,*007.mx,*007ok.cc,*00base.com,*010lm.com,*010time.com,*016788.com,*01happy.com,*01hr.com,*01lm.com,*01shangwu.com,*020883.com,*021025.com,*022net.com,*022show.com,*023dg.com,*025tata.com,*02753.com,*027art.com,*028search.com,*028share.com,*029gc.net,*0371gt.com,*0394dk.com,*03964.com,*03wx.com,*05120512.com,*0512118114.com,*0512kd.com,*0531.com,*0532gc.com,*0532gcw.com,*0551bike.com,*0566che.com,*0569.com,*0574shop.com,*0577bike.com,*0577men.com,*0577net.com,*0577wh.com,*057s.com,*0592sl.com,*0595.com,*0598yu.com,*05jk.com,*05sun.com,*05wan.com,*060s.com,*061100.com,*0622jj.com,*06621.com,*0669.cc,*06climate.com,*07073.com,*0713hb.com,*071711.com,*0737mp.com,*075501.com,*0817cg.com,*08279.com,*0830bbs.com,*0931007.com,*09dy.com,*0x110.com,*1000chi.com,*1000eb.com,*10010.com,*10010js.com,*10086.com,*100che.org,*100ksw.com,*100ksw.net,*100tm.com,*100ydy.com,*100ye.com,*100yue.com,*10628106.com,*107cine.co
from __future__ import print_function
import glob
import os
import re
old_method_syntax = re.compile('[A-Z][\w\d_]+\.[\w\d_]+\(self')
cwd = os.getcwd()
files = glob.glob(os.path.join(cwd, '*.py'))
# A Github Webhook endpoint that triggers Koji builds
#
# Add a Webhook to your repo and point it to where you run this.
#
# It builds packages when you add #kojibuild to the commit message.
# If you add #scratch it will scratch build
#
# It assumes that you have a folder per package + version folder like:
# jetty/8.1.9/jetty-8.1.9.spec
#
"""
This file contains code that, when run on Python 2.7.5 or earlier, creates
a string that should not exist: u'\Udeadbeef'. That's a single "character"
that's illegal in Python because it's outside the valid Unicode range.
It then uses it to crash various things in the Python standard library and
corrupt a database.
On Python 3... well, this file is full of syntax errors on Python 3. But
if you were to change the print statements and byte literals and stuff:
@henrysher
henrysher / retry.py
Created October 15, 2013 06:33 — forked from anonymous/retry.py
# Patches on Boto Retry Strategy
"""
Handles the check whether it need to retry or not
"""
from __future__ import with_statement
import json
import boto
from xml.dom.minidom import parseString
# coding: utf-8
from __future__ import division
import re
import os
import time
import bottle
from xml.dom.minidom import parseString
from math import *
helpstr = '''\