Skip to content

Instantly share code, notes, and snippets.

View minhchu's full-sized avatar
🎯
Focusing

Minh Chu minhchu

🎯
Focusing
View GitHub Profile
@minhchu
minhchu / cmd
Created September 23, 2016 15:53
1. copy above files to your local folder
2. run `npm install`
3. run `npm -g gulp`
4. run `gulp sass`
5. run `gulp browser-sync`
@minhchu
minhchu / app.js
Created February 28, 2017 07:17
Nginx and Express Morgan configurations for logging in production
'use strict';
const app = express();
...
app.set('trust proxy', true);
if (process.env.ENVIRONMENT == 'development') {
app.use(logger('dev'));
} else {
@minhchu
minhchu / App.js
Created July 14, 2017 15:29
style input with close button. RN 0.46
import React, { Component } from 'react';
import { Text, View, TextInput, StyleSheet, TouchableHighlight } from 'react-native';
export default class App extends Component {
render() {
return (
<View>
<View style={styles.wrapper}>
<TextInput
underlineColorAndroid={'transparent'}
{
"q": "chicken",
"from": 0,
"to": 3,
"params": {
"sane": [ ],
"to": [
"3"
],
"q": [
@minhchu
minhchu / hourly_response.json
Last active July 27, 2017 08:55
wunderground api's response
{
"response": {
"version": "0.1",
"termsofService": "http://www.wunderground.com/weather/api/d/terms.html",
"features": {
"hourly": 1
}
},
"hourly_forecast": [
{
@minhchu
minhchu / webpack-devserver.js
Created November 4, 2018 09:08 — forked from michaelrambeau/webpack-devserver.js
Script to launch webpack dev server (instead of using `webpack-dev-server --content-base www --hot` command).
// node.js server used to serve assets bundled by Webpack
// use `npm start` command to launch the server.
const webpack = require('webpack');
const WebpackDevServer = require('webpack-dev-server');
const config = require('../../config/webpack.local.config');
console.log('Starting the dev web server...');
const port = 8080;
const path = require('path');
const options = {
@minhchu
minhchu / usage.jsx
Created November 28, 2018 06:57
React Role Based Authorization
const User = Authorization(['user', 'manager', 'admin'])
const Manager = Authorization(['manager', 'admin'])
const Admin = Authorization(['admin'])
const UserPage = User(Users)
const EditUserPage = Manager(EditUser)
const CreateUserPage = Admin(CreateUser)
<Router history={BrowserHistory}>
<Route path="/" component={App}>
@minhchu
minhchu / delete.py
Created December 18, 2018 10:32
Mixpanel delete profiles
from mixpanel_api import Mixpanel
if __name__ == '__main__':
# API_Secret and Token of a Beeketing platform project
secret = ''
token = ''
mixpanel = Mixpanel(secret, token, pool_size=4, debug=True)
selector = '(properties["to_delete"] == true)'
parameters = {'selector': selector}
@minhchu
minhchu / cmd.sh
Created March 22, 2019 03:25
Resolve conflict on PR
# on feature branch
git fetch origin staging
git merge origin/staging
@minhchu
minhchu / simple-git-branching-model.md
Created July 15, 2020 08:42 — forked from chalasr/simple-git-branching-model.md
a simple git branching model

a simple git branching model

This is a very simple git workflow. It (and variants) is in use by many people. I settled on it after using it very effectively at Athena. GitHub does something similar; Zach Holman mentioned it in this talk.

Update: Woah, thanks for all the attention. Didn't expect this simple rant to get popular.