Skip to content

Instantly share code, notes, and snippets.

View wynemo's full-sized avatar
:octocat:
吃土中

Nemo.Zhang wynemo

:octocat:
吃土中
View GitHub Profile
@wynemo
wynemo / youtube-dl.txt
Last active September 22, 2016 03:44
youtube-dl.txt
set http_proxy=http://127.0.0.1:7000
set https_proxy=http://127.0.0.1:7000
set path=%path%;C:\bin\ffmpeg\bin
python C:\cygwin\tmp\youtube-dl twiter-video-link
Flush All Rules, Delete All Chains, and Accept All
This section will show you how to flush all of your firewall rules, tables, and chains, and allow all network traffic.
Note: This will effectively disable your firewall. You should only follow this section if you want to start over the configuration of your firewall.
First, set the default policies for each of the built-in chains to ACCEPT. The main reason to do this is to ensure that you won't be locked out from your server via SSH:
sudo iptables -P INPUT ACCEPT
sudo iptables -P FORWARD ACCEPT
sudo iptables -P OUTPUT ACCEPT
@wynemo
wynemo / ajax.js
Created April 18, 2016 14:57
simple ajax in chrome console
var ajax = {};
ajax.x = function() {
if (typeof XMLHttpRequest !== 'undefined') {
return new XMLHttpRequest();
}
var versions = [
"MSXML2.XmlHttp.5.0",
"MSXML2.XmlHttp.4.0",
"MSXML2.XmlHttp.3.0",
"MSXML2.XmlHttp.2.0",
@wynemo
wynemo / 把玩tushare.md
Created December 21, 2015 08:57
把玩tushare.md

https://github.com/waditu/tushare 安装需要 pandas, lxml 为何不在requirements里写出来呢

import tushare as ts df = ts.get_realtime_quotes('399006') df[['code','name','price','bid','ask','volume','amount','time']] code name price bid ask volume amount time 0 399006 创业板指 2829.921 0.000 0.000 1493729306 46653540296.720 15:05:53

@wynemo
wynemo / my-sha256.py
Created October 7, 2015 14:53
python my-sha256.py your_file
import hashlib
import sys
h = hashlib.sha256()
f = sys.argv[1]
with open(f, 'rb') as f:
while 1:
s = f.read(64*1024)
if not s:
break
@wynemo
wynemo / gist:4e26f5e151d068aa76f1
Created September 28, 2015 08:19
push creates new remote head on branch
push creates new remote head on branch
from time to time, `hg push` throws this message
I'm pretty sure that no code needs to be merged.
`hg push -b yourbranch` solve this
and I don't care why.
@wynemo
wynemo / setup_mosh_centos.sh
Last active September 28, 2015 03:16 — forked from tancnle/setup_mosh_centos.sh
Setup mosh on Centos 6.x
#!/bin/sh
# Update latest epel
wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
sudo rpm -Uvh epel-release-6-8.noarch.rpm
yum --enablerepo=epel install mosh
twitter.com
facebook.com
youtube.com
youtu.be
ggpht.com
gstatic.com
googlesyndication.com
googlevideo.com
ytimg.com
google.com
#!/usr/bin/env python
#coding:utf-8
import re
import sys
import os
t = sys.argv[1]
with open('.git/config', 'rb') as f:
s = f.read()
@wynemo
wynemo / sphinx_document.md
Last active December 22, 2015 00:09
using sphinx to generate documents

install sphinx

$ pip install sphinx

use this python script to create a sphinx project

from sphinx import quickstart as qs

d = dict(

path = '.',