Skip to content

Instantly share code, notes, and snippets.

View zhenyanghua's full-sized avatar
🐢
I may be slow to respond.

Zhenyang Hua zhenyanghua

🐢
I may be slow to respond.
View GitHub Profile
;(function(exports) {
// export the class if we are in a Node-like system.
if (typeof module === 'object' && module.exports === exports)
exports = module.exports = SemVer;
// The debug function is excluded entirely from the minified version.
// Note: this is the semver.org version of the spec that it implements
// Not necessarily the package version of this code.
@zhenyanghua
zhenyanghua / .block
Created January 17, 2021 00:57 — forked from d3indepth/.block
Spinning globe
license: gpl-3.0
height: 440
border: no
@zhenyanghua
zhenyanghua / .block
Created January 16, 2021 17:13 — forked from d3indepth/.block
D3 geo lines, circles and graticule
license: gpl-3.0
height: 420
border: no
@zhenyanghua
zhenyanghua / 1.Prerequisites.md
Created June 28, 2016 14:05 — forked from erodewald/1.Prerequisites.md
Reverse proxy on Windows with Apache 2.4 for Couchpotato/Sonarr

###Pre-requisites:

  1. Any version of Windows newer than XP or Server 2003.
  2. A good text editor. I recommend Sublime Text 2.
  3. If you use Sublime Text, you can get very helpful syntax highlighting while editing Apache Conf files by installing Package Control. Once fully installed and SublimeText is restarted, CTRL+SHIFT+P -> Install Package -> ApachConf (enter).
  4. This assumes you have a public domain pointing to your WAN IP. Figure that out from whatismyip.com. If you purchase a domain and use a CNAME or A-record, it can take some time for the DNS changes to propagate. I've seen anywhere from 15 mins to several hours.
  5. Within your router, you must forward port 80 to your LAN IP which hosts Apache.
@zhenyanghua
zhenyanghua / app.js
Last active April 21, 2016 19:03 — forked from johnlindquist/app.js
Toggle Subscription
const Observable = Rx.Observable;
const toggleButton = document.querySelector('#toggle');
const toggleClick$ = Observable.fromEvent(toggleButton, 'click');
const interval$ = Observable.interval(1000);
const toggle$ = toggleClick$
.startWith(false)
.scan((acc, curr)=> !acc); //toggles true/false