Skip to content

Instantly share code, notes, and snippets.

View zhangolve's full-sized avatar

zhangolve zhangolve

  • 北京
View GitHub Profile

1. Clone your fork:

git clone [email protected]:YOUR-USERNAME/YOUR-FORKED-REPO.git

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

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
@zhangolve
zhangolve / EventSystem.js
Created January 19, 2017 06:31 — forked from tsuz/EventSystem.js
EventSystem that I use with React.js to communicate between components
"use strict"
class EventSystem{
constructor() {
this.queue = {};
this.maxNamespaceSize = 50;
}
@zhangolve
zhangolve / proxy.js
Created November 28, 2016 10:53 — forked from ruanyf/proxy.js
使用 Proxy 实现观察者模式
// 实现
const queuedObservers = new Set();
const observe = fn => queuedObservers.add(fn);
const observable = obj => new Proxy(obj, {set});
function set(target, key, value, receiver) {
const result = Reflect.set(target, key, value, receiver);
queuedObservers.forEach(observer => observer());
return result;
@zhangolve
zhangolve / 0_reuse_code.js
Created August 13, 2016 09:17
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@zhangolve
zhangolve / index.html
Created July 5, 2016 12:22 — forked from anonymous/index.html
input-latlng-get-geo
<body>
<h1>输入经纬度值</h1>
<br><p>latitude</p>
<input id="latitude"> </input>
<br>
<p>longitude</p>
<input id="longitude"> </input>
<br>
<button class="btn btn-primary" onclick="searchIt()"> Enter</button>
@zhangolve
zhangolve / index.html
Created April 24, 2016 11:25 — forked from anonymous/index.html
zhangolve-protfolio
<link href='http://fonts.googleapis.com/css?family=Oleo+Script' rel='stylesheet' type='text/css'>
<body id="bodypart">
<!-- the head of page start -->
<div class="row" id="head">
<table border="1" width="95%" height="60" cellpadding="0" cellspacing="0" align="center"> <tr> <td id="signature" >zhang olve</td> <td>about</td> <td>protfolio</td> <td>comment</td></tr> </table>
@zhangolve
zhangolve / re.py
Last active August 29, 2015 14:14 — forked from dervn/re.py
#用正则简单过滤html的<>标签
import re
str = "<img /><a>srcd</a>hello</br><br/>"
str = re.sub(r'</?\w+[^>]*>','',str)
print str