Skip to content

Instantly share code, notes, and snippets.

Jianxin Gao j-gao

Block or report user

Report or block j-gao

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
@j-gao
j-gao / perceptron.py
Created Sep 27, 2016 — forked from bhumphreys/perceptron.py
Playing with making a simple perceptron in Python. Used Foundations of Statistical Natural Language Processing as a reference.
View perceptron.py
# Ben's Magical Perceptron
def dot_product(a, b):
return sum([a[i]*b[i] for i in range(len(a))])
def decision( x, w, theta ):
return (dot_product(x, w) > theta)
@j-gao
j-gao / auth.py
Created Sep 27, 2016 — forked from velocityzen/auth.py
This script take pictures from directory and post it to tumblr blog and then delete it. Tumblr API v2! This example for oath file upload.
View auth.py
import urlparse
import oauth2 as oauth
consumer_key = ''
consumer_secret = ''
request_token_url = 'http://www.tumblr.com/oauth/request_token'
access_token_url = 'http://www.tumblr.com/oauth/access_token'
authorize_url = 'http://www.tumblr.com/oauth/authorize'
@j-gao
j-gao / linux_fun.md
Created Dec 13, 2015 — forked from marianposaceanu/linux_fun.md
How to have some fun using the terminal.
View linux_fun.md

Linux fun-o-matic

How to have some fun using the terminal.

  1. Install cowsay [0] via : sudo apt-get install cowsay
  2. Install fortune [1] via : sudo apt-get install fortune
  3. Make sure you have Ruby installed via : ruby -v
  4. Install the lolcat [2] via : gem gem install lolcat
  5. Profit!
@j-gao
j-gao / 0_reuse_code.js
Created Nov 20, 2015
Here are some things you can do with Gists in GistBox.
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
You can’t perform that action at this time.