Skip to content

Instantly share code, notes, and snippets.

@jeffhung
jeffhung / .gitconfig
Created October 7, 2019 10:18
Customize Git Configurations by Folders
# See: https://git-scm.com/docs/git-config#_conditional_includes
[includeIf "gitdir:~/company/works/"]
path = ~/company/works/gitconfig
[includeIf "gitdir:~/personal/works/"]
path = ~/personal/works/gitconfig
struct TestC
{
std::shared_ptr<Test> GetIntance();
Test* GetRawPointer();
Test& GetReference();
std::unique_ptr<Test> GetUniqueInstance();
}
@jeffhung
jeffhung / xapp.md
Last active September 5, 2018 01:09
xapp.sh

xapp.sh

Select X display in dialog to pick where to render your X application.

You can add these lines to your ~/.login file to switch to this behavior:

if ( $?DISPLAY  ) then
	xapp.sh --register "$DISPLAY";
	setenv DISPLAY_ORI	"$DISPLAY"
@jeffhung
jeffhung / SHELL
Last active November 14, 2016 07:07
Vagrantfile for Declaring Tax (2016)
$ VBoxManage list usbhost
Host USB Devices:
...
UUID: 248ee848-3d9e-47cc-96d7-779e54946e39
VendorId: 0x0bda (0BDA)
ProductId: 0x0169 (0169)
Revision: 97.35 (9735)
Port: 1
#pragma pack(push, 1) // exact fit - no padding
union A
{
int a[3];
struct {
int x;
int y;
int z;
} s;
};
MODULES =# list of sub modules
MODULES += src/common
MODULES += src/myspn-apiserver
MODULES += src/myspn-idp
MODULES += src/myspn-portal
MODULES += src/myspn-topcve
MODULES += src/spn-secured-defaults
MODULES += src/redis
MODULES += src/php-redis
@jeffhung
jeffhung / mysql-dump.sh
Created May 10, 2012 07:30
My script to backup mysql database as SQL as complete as possible. Note that this runs slowly.
#!/bin/sh
__exe_name__=`basename $0`;
__revision__=`echo '$Rev: 37 $' | cut -d' ' -f2`;
__rev_date__=`echo '$Date: 2007-12-25 00:32:28 +0800 (Tue, 25 Dec 2007) $' | cut -d' ' -f2`;
usage()
{
local ex=0;
if [ $# -gt 0 ]; then
function fn_akamai() {};
fn_akamai.prototype.tmexpr = function() {
return "sid=`mist-session` && mist-source $sid -m calc.in | mist-decode -l";
};
function fn_count(s) { this.s = s; }
fn_count.prototype.tmexpr = function() {
return this.s.tmexpr() + " | " + " count-lines ";
};
@jeffhung
jeffhung / irclog-osdc.tw-2012.txt
Created April 16, 2012 02:02
OSDC.tw 2012 IRC log
Before you enjoy the log, please consider attending OSDC.tw Hackathon:
https://github.com/jeffhung/osdc-2012-hackathon
Feel free to join the event to have fun and meet people, even if you have no
idea what to hack yet.
--- Log opened Sat Apr 14 07:08:57 2012
[20120414T073730+0800]< darkx> 大家早安
[20120414T083658+0800]< miyagawa> which building is the venue? http://www.sinica.edu.tw/as/map/asmap_c.html
@jeffhung
jeffhung / gist:1160862
Created August 21, 2011 17:12
IRC Log for #coscup in Aug, 2011.
--- Log opened Mon Aug 01 00:00:23 2011
--- Day changed Wed Aug 03 2011
[20110803T091729+0800]< sanyuan> w
--- Log closed Thu Aug 04 07:52:01 2011
--- Log opened Thu Aug 04 07:52:07 2011
[20110804T075207+0800]-!- Irssi: #coscup: Total of 27 nicks [3 ops, 0 halfops, 0 voices, 24 normal]
[20110804T075320+0800]-!- Irssi: Join to #coscup was synced in 77 secs
--- Day changed Mon Aug 08 2011
[20110808T130743+0800]-!- kyu is now known as kengyu
--- Day changed Tue Aug 09 2011