Skip to content

Instantly share code, notes, and snippets.

@yinghau76
yinghau76 / git-diffall
Created February 26, 2018 02:14
Git command to launch multiple file diff using Araxis Merge
#!/bin/sh
git diff --name-only "$@" | while read filename; do
git difftool "$@" -t araxis --no-prompt "$filename" &
done
src = $(wildcard *.c)
obj = $(src:.c=.o)
LDFLAGS =
myprog: $(obj)
$(CC) -o $@ $^ $(LDFLAGS)
.PHONY: clean
clean:

Keybase proof

I hereby claim:

  • I am yinghau76 on github.
  • I am yinghau76 (https://keybase.io/yinghau76) on keybase.
  • I have a public key whose fingerprint is 6B63 06F9 0B68 E377 0D48 F7B7 BDA3 F0E0 8ED3 2141

To claim this, I am signing this object:

@yinghau76
yinghau76 / test-1.S
Created September 12, 2015 06:06
Test arithmetic on Go custom integer type
~/tmp $ go build -gcflags=-S test-1.go | more
# command-line-arguments
"".main t=1 size=256 value=0 args=0x0 locals=0x70
0x0000 00000 (/Users/patrick/tmp/test-1.go:7) TEXT "".main(SB), $112-0
0x0000 00000 (/Users/patrick/tmp/test-1.go:7) MOVQ (TLS), CX
0x0009 00009 (/Users/patrick/tmp/test-1.go:7) CMPQ SP, 16(CX)
0x000d 00013 (/Users/patrick/tmp/test-1.go:7) JLS 231
0x0013 00019 (/Users/patrick/tmp/test-1.go:7) SUBQ $112, SP
0x0017 00023 (/Users/patrick/tmp/test-1.go:7) FUNCDATA $0, gclocals·7d2d5fca80364273fb07d5820a76fef4(SB)
0x0017 00023 (/Users/patrick/tmp/test-1.go:7) FUNCDATA $1, gclocals·5ef976c2593056b9243adf402ae9d952(SB)
@yinghau76
yinghau76 / Preferences.sublime-settings
Created May 24, 2014 20:28
Fira Mono in SublimeText
"font_face": "Fira Mono",
"font_size": 17,
"line_padding_bottom": -3,
"line_padding_top": -3,
@yinghau76
yinghau76 / gist:10375021
Created April 10, 2014 12:12
Fix duplicate 'open with'
/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -kill -r -domain local -domain user;killall Finder;echo "Open With has been rebuilt, Finder will relaunch"
@yinghau76
yinghau76 / Rakefile
Created March 16, 2014 04:17
Rake task to zip dSYM in RubyMotion project
namespace 'dsym' do
desc 'Archive dSYM'
task :zip do
App.config_without_setup.build_mode = :release
App.config_without_setup.distribution_mode = true
app_bundle = App.config.app_bundle('iPhoneOS')
app_dsym = app_bundle.sub(/\.app$/, '.dSYM')
app_dsym_zip = "#{app_dsym}-#{App.config.version}.zip"
if !File.exist?(app_dsym_zip) or File.mtime(app_dsym) > File.mtime(app_dsym_zip)
@yinghau76
yinghau76 / gist:8738716
Created January 31, 2014 17:56
ChrUbuntu/ChromeOS switch
To make ChrUbuntu the default, run:
sudo cgpt add -i 6 -P 5 -S 1 /dev/sda
To make Chrome OS the default again, either turn off Developer Mode, or run:
sudo cgpt add -i 6 -P 0 -S 1 /dev/sda
@yinghau76
yinghau76 / gist:8651364
Created January 27, 2014 16:07
Maven install file
mvn install:install-file -Dfile=<path-to-file> -DgroupId=<group-id> -DartifactId=<artifact-id> -Dversion=<version> -Dpackaging=<packaging>
@yinghau76
yinghau76 / gist:8651331
Created January 27, 2014 16:06
Fix Pow name forwording on Mac
sudo sysctl -w net.inet.ip.fw.enable=1