Skip to content

Instantly share code, notes, and snippets.

@dougio
dougio / declare_slf4jLog.xml
Created November 21, 2013 07:15
Eclipse java template for common error log in exception. example: try { // code } catch (Exception e) { <call error_log> }
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<templates>
<template autoinsert="true" context="java" deleted="false" description="SLF4J logger" enabled="true" name="logger">private static final Logger logger = LoggerFactory.getLogger(${enclosing_type}.class);
${imp:import(org.slf4j.Logger, org.slf4j.LoggerFactory)}</template>
</templates>
@dougio
dougio / gist:8330371
Last active January 2, 2016 16:29
simple 'tree' tool for mac bash
function tree {
if [[ -z "$1" ]]
then
TREEPATH="."
else
TREEPATH="$1"
fi
find $TREEPATH -print | sed -e "s;[^/]*/;|__;g;s;__|; |;g;"
}
@dougio
dougio / nw
Created January 13, 2014 02:51
node-webkit has a bug on mac, that is it often lost keyboard focus if it is started from terminal such as node-webkit.app/Contents/MacOS/node-webkit "PACKAGE_DIR" but use "open" works fine. https://github.com/rogerwang/node-webkit/wiki/How-to-run-apps#mac-os-x
#!/usr/bin/env bash
if [[ -z $1 ]]
then
APP_PATH="./"
else
APP_PATH="$1"
fi
open -n -a node-webkit "$APP_PATH"
@dougio
dougio / gist:f5c00ed09d50fc803742bbad755d1a16
Created March 27, 2017 05:02
update all my dev tools in the f GFW
#!/usr/bin/env zsh
export all_proxy=socks5://localhost:8388
curl -vL http://google.com/
echo upgrade: oh my zsh ...
env ZSH=$ZSH sh $ZSH/tools/upgrade.sh
echo update: homebrew ...