Skip to content

Instantly share code, notes, and snippets.

View fobbyal's full-sized avatar

Alex Liang fobbyal

View GitHub Profile
{
"vim.insertModeKeyBindings": [
{
"before": [
"j",
"k"
],
"after": [
"<Esc>"
]
@fobbyal
fobbyal / docker-cleanup-resources.md
Created January 13, 2018 14:19 — forked from bastman/docker-cleanup-resources.md
docker cleanup guide: containers, images, volumes, networks

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see: https://github.com/chadoe/docker-cleanup-volumes

$ docker volume rm $(docker volume ls -qf dangling=true)

$ docker volume ls -qf dangling=true | xargs -r docker volume rm

@fobbyal
fobbyal / package.json
Created November 7, 2016 19:16
cover example
{
"name": "tracker-ext-ui",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"start": "node serve -m rhl3",
"serve:dev": "node serve --mock false",
"preserve:dist": "node_modules/.bin/rimraf dist",
"serve:dist": "node serve -m prod --mock false",
@fobbyal
fobbyal / nginx.conf
Created August 2, 2016 19:22 — forked from plentz/nginx.conf
Best nginx configuration for improved security(and performance). Complete blog post here http://tautt.com/best-nginx-configuration-for-security/
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
AuthPolicy.registerAuthScheme(AuthPolicy.NTLM, JCIFS_NTLMScheme.class);
HttpTransportProperties.Authenticator auth = new HttpTransportProperties.Authenticator();
auth.setUsername("USER");
auth.setPassword("PASSWORD");
auth.setDomain("DOMAIN");
auth.setHost("host.com");
auth.setPort(443);
List authPrefs = new ArrayList(1);
authPrefs.add(AuthPolicy.NTLM);
auth.setAuthSchemes(authPrefs);
@fobbyal
fobbyal / Card.js
Last active January 28, 2016 19:53
export default class CardsTable extends React.Component {
constructor(props) {
super(props);
this.state = {data: []};
}
createDuplicates = (arr) => {
let doubleArr = arr.slice(0);
for (let obj of arr) {
let clone = JSON.parse(JSON.stringify(obj));
let todo = (state={},action) => {};
let menus = {state={},action} => {};
var combined=combineReducers({ todos, menus });
export (state = {} , action) => {
if(aciton.type='MASS_UPDATE') {
//do mass tree update
return //new state;
}else{
@fobbyal
fobbyal / gist:ce187b96619cc65432f6
Last active January 22, 2016 02:12 — forked from akolosov/gist:cedaac86b333a4ced95f
vim 7.4 with lua+GUI on Ubuntu 14.04
#!/bin/sh
sudo apt-get remove --purge vim vim-runtime vim-gnome vim-tiny vim-common vim-gui-common
sudo apt-get install liblua5.1-dev luajit libluajit-5.1 python-dev ruby-dev libperl-dev mercurial libncurses5-dev libgnome2-dev libgnomeui-dev libgtk2.0-dev libatk1.0-dev libbonoboui2-dev libcairo2-dev libx11-dev libxpm-dev libxt-dev
sudo mkdir /usr/include/lua5.1/include
sudo ln -s /usr/include/luajit-2.0 /usr/include/lua5.1/include
cd ~
git clone https://github.com/vim/vim.git