Skip to content

Instantly share code, notes, and snippets.

@WitzHsiao
WitzHsiao / proxy.js
Created November 29, 2016 10:04 — forked from nakedible-p/proxy.js
AWS ES proxy
var AWS = require('aws-sdk');
var http = require('http');
var httpProxy = require('http-proxy');
var express = require('express');
var bodyParser = require('body-parser');
var stream = require('stream');
if (process.argv.length != 3) {
console.error('usage: aws-es-proxy <my-cluster-endpoint>');
process.exit(1);
@WitzHsiao
WitzHsiao / index.md
Created September 22, 2016 12:37 — forked from alekseykulikov/index.md
SUIT CSS naming convention for React.js application

Recently CSS has got a lot of negativity. But I would like to defend it and show, that with good naming convention CSS works pretty well.

My 3 developers team has just developed React.js application with 6561 lines of CSS (and just 5 !important). During one year of development we had 0 issues with CSS. No refactoring typos, no style leaks, no performance problems, possibly, it is the most stable part of our application.

Here are main principles we use to write CSS for modern (IE11+) browsers:

@WitzHsiao
WitzHsiao / react-native-gitignore
Created June 27, 2016 10:33 — forked from ryantbd/react-native-gitignore
react-native-gitignore
# Most part of this file is created by https://www.gitignore.io
### Node ###
# Logs
logs
*.log
# Runtime data
pids
*.pid
@WitzHsiao
WitzHsiao / introrx.md
Created April 29, 2016 11:59 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
@WitzHsiao
WitzHsiao / gist:cad22c569f81983ed9f7487f832aa8dc
Created April 29, 2016 10:08 — forked from jiecuoren/gist:0d0bff2efa48e03c2fc5
when use fish, something you will find error: E79: Cannot expand wildcards
open ~/.config/fish/config.fish
add: set -x SHELL /bin/bash
@WitzHsiao
WitzHsiao / gist:7d110c4cfd3b2bc19e86
Last active September 24, 2015 16:43
learned from using gomobile
Building:
gomobile: unsupported, direct named type core.User: struct{Id string; Mobile string; Email string}
-> using pointer in function
panic: unsupported seqType: []string(string) / *types.Slice(*types.Basic)
Runtime:
go_seq_writeRef on objective-c objects is not permitted
/** Converts NSData to a hexadecimal string. */
@interface NSData (NSData_hexadecimalString)
/** Changes NSData object to a hex string.
@returns hexadecimal string of NSData. Empty string if data is empty.*/
- (NSString *)hexadecimalString;
@end
@implementation NSData (NSData_hexadecimalString)