Skip to content

Instantly share code, notes, and snippets.

@hujunxianligong
hujunxianligong / web-servers.md
Created September 23, 2018 07:24 — forked from willurd/web-servers.md
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@hujunxianligong
hujunxianligong / gist:ca99158dd79f2fe696bd27f3a97c3ad8
Created August 3, 2018 15:47 — forked from syllog1sm/gist:10343947
A simple Python dependency parser
"""A simple implementation of a greedy transition-based parser. Released under BSD license."""
from os import path
import os
import sys
from collections import defaultdict
import random
import time
import pickle
SHIFT = 0; RIGHT = 1; LEFT = 2;
@hujunxianligong
hujunxianligong / build.sh
Created January 11, 2018 14:07 — forked from Artanis/build.sh
Python C Extension Hello World
gcc -fpic --shared $(python-config --includes) greetmodule.c -o greetmodule.so
@hujunxianligong
hujunxianligong / mnist_cnn_bn.py
Created May 16, 2017 11:54 — forked from tomokishii/mnist_cnn_bn.py
MNIST using Batch Normalization - TensorFlow tutorial
#
# mnist_cnn_bn.py date. 5/21/2016
#
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import numpy as np
@hujunxianligong
hujunxianligong / enable_bbr.sh
Created March 18, 2017 15:07
Update linux kernel and enable google bbr on ubuntu
#!/bin/sh
# update kernel
wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.10-rc1/linux-image-4.10.0-041000rc1-generic_4.10.0-041000rc1.201612252031_amd64.deb
dpkg -i linux-image-4.10.0*.deb
update-grub
reboot
# check kernel
uname -a
@hujunxianligong
hujunxianligong / rbm_after_refactor.py
Created December 15, 2016 06:37 — forked from gabrieleangeletti/rbm_after_refactor.py
Restricted Boltzmann Machine implementation in TensorFlow, before and after code refactoring. Blog post: http://blackecho.github.io/blog/programming/2016/02/21/refactoring-rbm-tensor-flow-implementation.html
import tensorflow as tf
import numpy as np
import os
import zconfig
import utils
class RBM(object):