Skip to content

Instantly share code, notes, and snippets.

View swarut's full-sized avatar
💭
TapiUnicornnnnnn

Warut Surapat swarut

💭
TapiUnicornnnnnn
  • Medidata Solutions
  • Tokyo, Japan
View GitHub Profile
@swarut
swarut / gist:3774851
Created September 24, 2012 07:57
Git : Showing a file at a specific commit
git show <treeish>:filename
#<treeish> can be something like HEAD~3 or a hash number.
@swarut
swarut / .bash_profile
Created September 13, 2012 15:00
Bash : My Bash Profile
if [ -f `brew --prefix`/etc/bash_completion ]; then
. `brew --prefix`/etc/bash_completion
fi
export CLICOLOR=1
export LSCOLORS=cxfxcxdxbxegedabagacad
export GREP_OPTIONS='--color=auto'
source "`brew --prefix`/etc/grc.bashrc"
@swarut
swarut / gist:2354762
Created April 10, 2012 21:37
Android : Custom view from ViewGroup
public class MyCustomView extends LinearLayout{
public MyCustomView(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
View.inflate(context, R.layout.your_layout_name, this);
}
public MyCustomView(Context context, AttributeSet attrs) {
this(context, null, 0);
}
public MyCustomView(Context context) {
this(context, null);
@swarut
swarut / gist:2343507
Created April 9, 2012 13:46
Android : InputType property for Android's EditText
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id = "@+id/login_tel"
android:inputType="phone"
/>