This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<EditText | |
android:layout_width="match_parent" | |
android:layout_height="wrap_content" | |
android:id = "@+id/login_tel" | |
android:inputType="phone" | |
/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git show <treeish>:filename | |
#<treeish> can be something like HEAD~3 or a hash number. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class UserParser | |
attr_reader :mentioned_users | |
def mention_users | |
@mentioned_users ||= <some processing> | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
before do | |
User.stub(:where) do |like_query, bind_param| | |
case bind_param | |
when 'Bob%' then [bob] | |
when 'Jane%' then [jane] | |
else [] | |
end | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
UIStoryboard *storyboard = self.storyboard; | |
MyViewController *view = [storyboard instantiateViewControllerWithIdentifier:@"MyViewController"]; | |
self.view.window.rootViewController = view; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NSUserDefaults *userPreference = [NSUserDefaults standardUserDefaults]; | |
[userPreference setValue:user_info forKey:@"key"]; | |
[userPreference removeObjectForKey:@"key"] | |
[userPreference synchronize];] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-(void) request{ | |
NSString *targetUrlString = @"url"; | |
NSURL *targetUrl = [NSURL URLWithString:targetUrlString]; | |
NSData *data = [NSData dataWithContentsOfURL:targetUrl]; | |
[self performSelectorInBackground:@selector(callback:) withObject:data]; | |
} | |
-(void) callBack:(NSData*)respondedData{ | |
NSError *error; | |
NSDictionary *dataDic = [NSJSONSerialization |
OlderNewer