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
@zhenyanghua
zhenyanghua / webpack.config.js
Created July 28, 2016 02:26
learn-react-server-v0.0.1
import path from 'path';
import webpack from 'webpack';
module.exports = {
devtool: 'cheap-module-eval-source-map',
entry: [
'webpack-hot-middleware/client',
'./index'
],
output: {
@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
@zhenyanghua
zhenyanghua / style.css
Created March 31, 2016 23:20
Bootstrap tab content style fix.
.tab-content > .tab-pane { display: block; height: 0; overflow: hidden; }
.tab-content > .active { display: block; height: auto; }
@zhenyanghua
zhenyanghua / Readme.md
Last active March 16, 2016 15:34
Migration from SVN to GIT

Migration from SVN to Git

Migration is not always easy. However, git-svn is a quite useful tool to do the job.

To do the job right, this post from stackoverflow is tremendously helpful in my entire process.

I wrote the m.py to automate the entire process.

@zhenyanghua
zhenyanghua / .svnignore
Last active January 20, 2016 22:52
SVN Commands
.git
.gitignore
.DS_Store
/log
/public/*.JPEG
/public/*.jpeg
/public/*.png
/public/*.gif
@zhenyanghua
zhenyanghua / Readme.md
Last active December 16, 2016 02:57
ArcGIS Web Appbuilder Secrets

Up and run with Tutorial

Esri Tutorial covers most part of the content for you to get up and running a customized widget that can be used in the Web Appbuilder.

However, the current release of the Appbuilder (1.3) is still buggy and doesn't cover some on-demand customization. Here are some points that will come in handy when you need them.

How to debug a widget in development?

How to debug a configuration page in development?

@zhenyanghua
zhenyanghua / .gitignore
Created May 14, 2015 14:44
Git Ignore List
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
# Packages #
@zhenyanghua
zhenyanghua / mobile.js
Created May 5, 2015 15:09
Detecting a mobile browser
function detectmob() {
if( navigator.userAgent.match(/Android/i)
|| navigator.userAgent.match(/webOS/i)
|| navigator.userAgent.match(/iPhone/i)
|| navigator.userAgent.match(/iPad/i)
|| navigator.userAgent.match(/iPod/i)
|| navigator.userAgent.match(/BlackBerry/i)
|| navigator.userAgent.match(/Windows Phone/i)
){
return true;
@zhenyanghua
zhenyanghua / index.html
Created May 5, 2015 14:59
iPhone CSS no image
<div class="phone">
<div id="case">
<div id="earsection">
<div id="camera"></div>
<div id="speaker"></div>
</div>
<div id="screen"></div>
<div id="button">
<div id="buttonsquare"></div>
</div>