Skip to content

Instantly share code, notes, and snippets.

View tanhauhau's full-sized avatar

Tan Li Hau tanhauhau

View GitHub Profile
var express = require('express'),
app = express(),
hr = require('express-console-warning');
app.use(hr.LOG('Hello world')
.text('This is a blue text', {color: 'blue', fontSize: 'x-large'})
.text('and this is red', {color: 'red', fontSize: 'x-large'})
.image('http://memesvault.com/wp-content/uploads/Best-Meme-Faces-14.png',0.1)
.build());
app.use(express.static('client'));
@tanhauhau
tanhauhau / docker-remove.sh
Last active September 18, 2016 05:40
Docker clean up
#!/bin/bash
# remove stopped container
docker rm -f $(docker ps -a -q | grep -v $(docker ps -q))
# remove none images
docker rmi $(docker images | grep "<none>" | awk '{print $3}')
@tanhauhau
tanhauhau / CustomComponent.js
Created November 16, 2017 15:19
React Redux
import React from 'react';
import { connect } from 'react-redux';
function CustomComponent() {
return <div></div>;
}
const mapStateToProps = state => { return {}; };
const mapDispatchToProps = dispatch => ( return {}; };
export default connect(mapStateToProps, mapDispatchToProps)(CustomComponent);
@tanhauhau
tanhauhau / CustomComponent.js
Created November 16, 2017 15:39
Inducer Example
import React from 'react';
import gameReducer from './gameReducer';
import injectReducer from 'inducer';
class CustomComponent extends React.Component {
// component logic here
}
export default injectReducer({
game: gameReducer
})(CustomComponent);
@tanhauhau
tanhauhau / CustomComponent.js
Created November 16, 2017 15:39
Inducer Example
import React from 'react';
import gameReducer from './gameReducer';
import injectReducer from 'inducer';
class CustomComponent extends React.Component {
// component logic here
}
export default injectReducer({
game: gameReducer
})(CustomComponent);
@tanhauhau
tanhauhau / config.ts
Created August 30, 2018 10:56
Test Manta Style
interface User {
/**
* @faker {{internet.userName}}
*/
userName: string;
gender: 0;
/**
* @faker date.past
*/
birthday: number;
@tanhauhau
tanhauhau / README.md
Created September 26, 2018 03:47
Custom Mattermost Style

Custom Mattermost style, styled with Stylus

Feature

  • Dracula At Night theme
  • Go crazy with H6 tag
  • Shake up and down with the 3 monkeys: 🙈 🙉 🙊
  • Rotate with trollface trollface
@tanhauhau
tanhauhau / README.md
Created September 26, 2018 04:14
Custom Lambda Pure theme for zsh!

Based on lambda-pure, but added a time based symbol, depending the time of your day!

TIME_BASED_PROMPT_SYMBOL="${PURE_PROMPT_SYMBOL:-λ}"
HOUR_OF_THE_DAY=$(date +"%H")

if [[ HOUR_OF_THE_DAY -eq "12" || HOUR_OF_THE_DAY -eq "13" ]]; then
  # lunch 
  TIME_BASED_PROMPT_SYMBOL="🍚"
elif [[ HOUR_OF_THE_DAY -eq "17" || HOUR_OF_THE_DAY -eq "18" ]]; then
@tanhauhau
tanhauhau / code.js
Created October 24, 2018 07:26
Code before uglify-js
function foo() {
var a = foobar();
var b = 8;
return 10;
}
@tanhauhau
tanhauhau / uglified-code.js
Last active October 24, 2018 08:13
Code after uglify-js
function foo(){
foobar();
return 10;
}