Skip to content

Instantly share code, notes, and snippets.

@jeffhung
jeffhung / .gitconfig
Created Oct 7, 2019
Customize Git Configurations by Folders
View .gitconfig
# 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
View fnalign.cpp
struct TestC
{
std::shared_ptr<Test> GetIntance();
Test* GetRawPointer();
Test& GetReference();
std::unique_ptr<Test> GetUniqueInstance();
}
View xapp.md

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 Nov 14, 2016
Vagrantfile for Declaring Tax (2016)
View SHELL
$ VBoxManage list usbhost
Host USB Devices:
...
UUID: 248ee848-3d9e-47cc-96d7-779e54946e39
VendorId: 0x0bda (0BDA)
ProductId: 0x0169 (0169)
Revision: 97.35 (9735)
Port: 1
View gist:befd6063bb62bc4bbf6c
#pragma pack(push, 1) // exact fit - no padding
union A
{
int a[3];
struct {
int x;
int y;
int z;
} s;
};
View foreach.mk
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
My script to backup mysql database as SQL as complete as possible. Note that this runs slowly.
View mysql-dump.sh
#!/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
View gist:2434806
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 ";
};
View irclog-osdc.tw-2012.txt
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 Aug 21, 2011
IRC Log for #coscup in Aug, 2011.
View gist:1160862
--- 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