Skip to content

Instantly share code, notes, and snippets.

View quanganhdo's full-sized avatar

Anh Do quanganhdo

View GitHub Profile
0x00625dF34A013966240029a798B645815fdda415
@quanganhdo
quanganhdo / mount-fat32
Created June 13, 2017 16:22 — forked from miguelmota/mount_fat32.sh
OS X mount FAT32 partition with read/write permissions
# diskutil list
diskutil unmount /dev/disk0s6
sudo mount -w -t msdos /dev/disk0s6 /Volumes/data
@quanganhdo
quanganhdo / finder_icons.sh
Created September 4, 2016 18:55 — forked from chockenberry/finder_icons.sh
A simple shell script to turn the Finders desktop icons on and off
#!/bin/sh
defaults read com.apple.finder CreateDesktop > /dev/null 2>&1
enabled=$?
if [ "$1" = "off" ]; then
if [ $enabled -eq 1 ]; then
defaults write com.apple.finder CreateDesktop false
osascript -e 'tell application "Finder" to quit'
open -a Finder
@quanganhdo
quanganhdo / main.m
Created March 24, 2016 10:33 — forked from steventroughtonsmith/main.m
Load Mach-O executable at runtime and execute its entry point
void callEntryPointOfImage(char *path, int argc, char **argv)
{
void *handle;
int (*binary_main)(int binary_argc, char **binary_argv);
char *error;
int err = 0;
printf("Loading %s\n", path);
handle = dlopen (path, RTLD_LAZY);

Keybase proof

I hereby claim:

  • I am quanganhdo on github.
  • I am quanganhdo (https://keybase.io/quanganhdo) on keybase.
  • I have a public key whose fingerprint is 9459 9780 5AA7 0952 F4F2 058A B347 BCC7 2FF3 D8AF

To claim this, I am signing this object:

{
{I have|I've} been {surfing|browsing} online more than {three|3|2|4} hours today, yet I never found any interesting article like yours. {It's|It
is} pretty worth enough for me. {In my opinion|Personally|In my view}, if all {webmasters|site owners|website owners|web owners} and bloggers made good content as
you did, the {internet|net|web} will be {much more|a lot more}
useful than ever before.|
I {couldn't|could not} {resist|refrain from} commenting. {Very well|Perfectly|Well|Exceptionally well} written!|
{I will|I'll} {right away|immediately} {take hold of|grab|clutch|grasp|seize|snatch}
your {rss|rss feed} as I {can not|can't} {in finding|find|to find} your {email|e-mail} subscription {link|hyperlink} or {newsletter|e-newsletter} service. Do {you have|you've} any?
{Please|Kindly} {allow|permit|let} me {realize|recognize|understand|recognise|know} {so that|in order that} I {may just|may|could} subscribe.
Thanks.|
@quanganhdo
quanganhdo / gist:5430604
Created April 21, 2013 18:53
cmus' format_string
%-40%t %-5%d %-20%a %-30%l %= %n
@quanganhdo
quanganhdo / gist:5430601
Created April 21, 2013 18:53
Current Track
terminal-notifier -subtitle "`/usr/local/bin/cmus-remote -Q | grep 'tag title' | sed 's/tag title//'`" -message "`/usr/local/bin/cmus-remote -Q | grep 'tag artist' | sed 's/tag artist//'`" -title "`/usr/local/bin/cmus-remote -Q | grep 'tag album' | sed 's/tag album//'`"
@quanganhdo
quanganhdo / gist:5430598
Last active December 16, 2015 11:49
Open cmus in new iTerm tab
tell application "iTerm"
activate
tell the first terminal
launch session "Default Session"
tell the last session
write text "cmus"
end tell
end tell
end tell
@quanganhdo
quanganhdo / gist:5430597
Last active December 16, 2015 11:49
Play/Pause cmus
/usr/local/bin/cmus-remote -u