Skip to content

Instantly share code, notes, and snippets.

View bearzk's full-sized avatar

Kai Zhang bearzk

View GitHub Profile
#!/usr/bin/env python
#
# Converts any integer into a base [BASE] number. I have chosen 62
# as it is meant to represent the integers using all the alphanumeric
# characters, [no special characters] = {0..9}, {A..Z}, {a..z}
#
# I plan on using this to shorten the representation of possibly long ids,
# a la url shortenters
#
@fabiant7t
fabiant7t / s3_multipart_upload.py
Created April 17, 2011 14:54
Parallel S3 multipart upload with retries
import logging
import math
import mimetypes
from multiprocessing import Pool
import os
from boto.s3.connection import S3Connection
from filechunkio import FileChunkIO
@Eric-Guo
Eric-Guo / gist:2011069
Created March 10, 2012 10:20
Sublime Text 2 - Useful Shortcuts (Windows 7 CHS)

Sublime Text 2 – Useful Shortcuts (PC)

Loosely ordered with the commands used most towards the top. Sublime also offer full documentation.

Editing

Ctrl+⇧+K delete line
Ctrl+↩ insert line after
Ctrl+⇧+↩ insert line before
Ctrl+⇧+↑ move line (or selection) up
@erikreagan
erikreagan / mac-apps.md
Created August 4, 2012 19:18
Mac developer must-haves

Mac web developer apps

This gist's comment stream is a collection of webdev apps for OS X. Feel free to add links to apps you like, just make sure you add some context to what it does — either from the creator's website or your own thoughts.

— Erik

@greatghoul
greatghoul / 265g_pics.py
Created September 26, 2012 17:22
265g.com 美图下载
#-*- coding: utf-8 -*-
import urllib, re, os, argparse
RE_NEXT_URL = ur'<a href=\"(?!javascript\:)([^\"]*?)">下一页<\/a>'
RE_PICTURE = ur'<p\s+(?:align=\"center\")>\s*<img.*?src=\"(.*?)\".*?\/?>'
RE_ARCTITLE = ur'var arctitle=\'(.*?)\';'
def get_html(url):
try:
return urllib.urlopen(url).read().decode('gbk')
@dps
dps / sudoku.py
Created December 29, 2012 17:00
def r(a):
i=a.find('0')
if i<0:print a
[m in[(i-j)%9*(i/9^j/9)*(i/27^j/27|i%9/3^j%9/3)or a[j]for
j in range(81)]or r(a[:i]+m+a[i+1:])for m in`14**7*9`]
r(raw_input())
@josiahcarlson
josiahcarlson / steg.py
Last active December 17, 2015 05:39
Steganography in Python
# -*- coding: utf-8 -*-
'''
Steganogrphy in Python
Copyright 2013 Josiah Carlson
Released under the GNU LGPL v2.1 license
What, how, why, etc, are discussed:
http://www.dr-josiah.com/2013/05/steganography-in-python.html
@stebennett
stebennett / feeds.opml
Created August 12, 2016 15:24
The feeds I currently subscribe to.
<?xml version="1.0" encoding="UTF-8"?>
<opml version="1.0">
<head>
<title>Stephen subscriptions in feedly Cloud</title>
</head>
<body>
<outline text="Companies" title="Companies">
<outline type="rss" text="Trello" title="Trello" xmlUrl="https://trello.engineering/feed.xml" htmlUrl="http://tech.trello.com/"/>
<outline type="rss" text="IMVU" title="IMVU" xmlUrl="http://engineering.imvu.com/feed/" htmlUrl="https://engineering.imvu.com"/>

FWIW: I (@rondy) am not the creator of the content shared here, which is an excerpt from Edmond Lau's book. I simply copied and pasted it from another location and saved it as a personal note, before it gained popularity on news.ycombinator.com. Unfortunately, I cannot recall the exact origin of the original source, nor was I able to find the author's name, so I am can't provide the appropriate credits.


Effective Engineer - Notes

What's an Effective Engineer?

#!/bin/bash
###
### my-script — does one thing well
###
### Usage:
### my-script <input> <output>
###
### Options:
### <input> Input file to read.
### <output> Output file to write. Use '-' for stdout.