Skip to content

Instantly share code, notes, and snippets.

View wangshub's full-sized avatar
❤️
Good news, everyone!

Wason wangshub

❤️
Good news, everyone!
View GitHub Profile
@wangshub
wangshub / cors.nginxconf
Created August 30, 2019 08:27 — forked from pauloricardomg/cors.nginxconf
Nginx configuration for CORS-enabled HTTPS proxy with origin white-list defined by a simple regex
#
# Acts as a nginx HTTPS proxy server
# enabling CORS only to domains matched by regex
# /https?://.*\.mckinsey\.com(:[0-9]+)?)/
#
# Based on:
# * http://blog.themillhousegroup.com/2013/05/nginx-as-cors-enabled-https-proxy.html
# * http://enable-cors.org/server_nginx.html
#
server {
@wangshub
wangshub / git_toturial
Created August 13, 2019 03:07 — forked from guweigang/git_toturial
git命令大全
git init # 初始化本地git仓库(创建新仓库)
git config --global user.name "xxx" # 配置用户名
git config --global user.email "xxx@xxx.com" # 配置邮件
git config --global color.ui true # git status等命令自动着色
git config --global color.status auto
git config --global color.diff auto
git config --global color.branch auto
git config --global color.interactive auto
git config --global --unset http.proxy # remove proxy configuration on git
git clone git+ssh://git@192.168.53.168/VT.git # clone远程仓库
@wangshub
wangshub / sampleREADME.md
Created July 31, 2019 03:00 — forked from FrancesCoronel/sampleREADME.md
A sample README for all your GitHub projects.

FVCproductions

INSERT GRAPHIC HERE (include hyperlink in image)

Repository Title Goes Here

Subtitle or Short Description Goes Here

@wangshub
wangshub / client.py
Created February 16, 2019 12:20 — forked from ninedraft/README.md
Python udp broadcast client server example
import socket
client = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) # UDP
client.setsockopt(socket.SOL_SOCKET, socket.SO_BROADCAST, 1)
client.bind(("", 37020))
while True:
data, addr = sock.recvfrom(1024)
print("received message: %s"%data)
@wangshub
wangshub / fish_alias.md
Created November 27, 2018 10:40 — forked from tikolakin/fish_alias.md
Create alias in Fish shell and save this as a permanent function

Directly from CLI

alias x='exit'
funcsave x

or create a file in

~/.config/fish/functions 

with name

Run Jupyterlab on docker

Build starting from a Jupyter 2.x image.

Build

docker build -t jupyterlab .
@wangshub
wangshub / README.md
Created September 14, 2018 12:00 — forked from zenorocha/README.md
A template for Github READMEs (Markdown) + Sublime Snippet

Project Name

TODO: Write a project description

Installation

TODO: Describe the installation process

Usage

@wangshub
wangshub / pg-pong.py
Created July 7, 2018 15:43 — forked from karpathy/pg-pong.py
Training a Neural Network ATARI Pong agent with Policy Gradients from raw pixels
""" Trains an agent with (stochastic) Policy Gradients on Pong. Uses OpenAI Gym. """
import numpy as np
import cPickle as pickle
import gym
# hyperparameters
H = 200 # number of hidden layer neurons
batch_size = 10 # every how many episodes to do a param update?
learning_rate = 1e-4
gamma = 0.99 # discount factor for reward
@wangshub
wangshub / Matrix.md
Created May 27, 2018 07:06 — forked from nadavrot/Matrix.md
Efficient matrix multiplication

High-Performance Matrix Multiplication

This is a short post that explains how to write a high-performance matrix multiplication program on modern processors. In this tutorial I will use a single core of the Skylake-client CPU with AVX2, but the principles in this post also apply to other processors with different instruction sets (such as AVX512).

Intro

Matrix multiplication is a mathematical operation that defines the product of

@wangshub
wangshub / server.js
Created April 8, 2018 09:38 — forked from palanik/server.js
Using D3 on node.js
/*
* npm install d3 node-jsdom
*/
var d3 = require('d3');
var jsdom = require('node-jsdom');
var http = require('http');
function svgDOM(width, height) {
// Setup DOM