Skip to content

Instantly share code, notes, and snippets.

Working from home

Shengjia Yan yanshengjia

Working from home
Block or report user

Report or block yanshengjia

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
mw-ferretti /
Last active Oct 13, 2019
Paypal button on markdown github


<!-- Sample of code generated --> 
<form action="" method="post" target="_top">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="hosted_button_id" value="RGQ8NSYPA59FL">
<input type="image" src="" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
<img alt="" border="0" src="" width="1" height="1">
sheharyarn /
Last active Oct 28, 2019
Mongodump Shell Script for Cronjob
TIMESTAMP=`date +%F-%H%M`
fupslot / gist:5015897
Created Feb 22, 2013
Javascript: Convert base64 to a Blob
View gist:5015897
function dataURItoBlob(dataURI, callback) {
// convert base64 to raw binary data held in a string
// doesn't handle URLEncoded DataURIs - see SO answer #6850276 for code that does this
var byteString = atob(dataURI.split(',')[1]);
// separate out the mime component
var mimeString = dataURI.split(',')[0].split(':')[1].split(';')[0]
// write the bytes of the string to an ArrayBuffer
var ab = new ArrayBuffer(byteString.length);
jholster / gist:2290574
Created Apr 3, 2012
Tornado multiprocess example
View gist:2290574
import tornado.web
import tornado.httpserver
import tornado.ioloop
class MainHandler(tornado.web.RequestHandler):
def get(self):
self.write("Greetings from the instance %s!" % tornado.process.task_id())
app = tornado.web.Application([
(r"/", MainHandler),
CristinaSolana / gist:1885435
Created Feb 22, 2012
Keeping a fork up to date
View gist:1885435

1. Clone your fork:

git clone

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://
git fetch upstream
didip /
Created Feb 12, 2011
Generates secure cookie secret for Tornado Web Framework
You can’t perform that action at this time.