Skip to content

Instantly share code, notes, and snippets.

@yenliangl
yenliangl / my-org-publish.el
Created January 5, 2012 08:21
Publish org to remote host via SSH
(require 'org-publish)
(setq org-directory "~/Dropbox/Org")
(setq org-internal-directory "~/Org")
(setq org-internal-publishing-directory (concat "/ssh:" user-login-name "@HOST01:~/public_html"))
(setq org-publish-project-alist
`( ;use back-quote
;; publish to public cloud
("org" :components ("org-notes" "org-static" "org-ebooks"))
;; publish to internal cloud
@yenliangl
yenliangl / open.sch
Created January 6, 2012 12:14
Mimic MacOSX 'open' command in Unbuntu and Windows
alias open='gnome-open' # in Ubuntu
alias open='cygstart' # in Windows/Cygwin
@yenliangl
yenliangl / TimePickerWithKeyboard.xml
Created January 6, 2012 12:59
TimePicker/DatePicker with keyboard problem
<TimePicker android:id="@+id/time_picker"
android:layout_marginTop="10dp"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:addStatesFromChildren="true"/>
android:layout_height="wrap_content"/>
@yenliangl
yenliangl / flac2alac.bash
Created March 12, 2012 05:39
Convert flac to Alac (Apple Lossless Audio Codec)
# convert flac files in current directory to Apple loss-less codec.
function flac2alac {
for f in *.flac; do
ffmpeg -i "$f" -acodec alac "${f%.flac}.m4a"
#-map_meta_data $f:${f%.flac}.m4a;
done
}
@yenliangl
yenliangl / fontconfig.properties
Created July 23, 2012 04:24
Java's fontconfig.properties file for Windows 7
# %W% %E%
#
# Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
#
# Version
version=1
# Component Font Mappings
@yenliangl
yenliangl / tee.csh
Created September 28, 2012 07:25
Use tee to save output of one command pipe and also to standard output
command |& tee output.ext
@yenliangl
yenliangl / flash.sh
Created September 29, 2012 09:09
flash recovery image
fastboot flash recovery image_to_flash.img
@yenliangl
yenliangl / make_file_visible.sh
Created September 29, 2012 09:11
Make file invisible/visible in MacOSX Finder
# invisible
setfile -a V afile.txt
# visible
setfile -a v afile.txt
@yenliangl
yenliangl / combine_multiple_pdf_files.sh
Created September 29, 2012 09:15
Combine multiple pdf files by pdftk
# combine several pdf files
pdftk file1.pdf file2.pdf file3.pdf cat output newfile.pdf
# combine files
pdftk *.pdf cat output newfile.pdf
@yenliangl
yenliangl / disable_DS_Store.sh
Created September 29, 2012 09:16
Prevent .DS_Store file creation
#
$ > defaults write com.apple.desktopservices DSDontWriteNetworkStores true