Skip to content

Instantly share code, notes, and snippets.

@neiraza
neiraza / gradle-highlight
Last active August 29, 2015 14:15
Vimで.gradleをシンタックスハイライト
echo 'au BufRead,BufNewFile *.gradle set filetype=groovy' > ~/.vim/ftdetect/gradle.vim
@neiraza
neiraza / reverseGeocoder
Created September 23, 2014 13:52
位置情報から住所を検索する
- (void)reverseGeocoder:(CLLocation *)location {
CLGeocoder *geocoder = [[CLGeocoder alloc] init];
[geocoder reverseGeocodeLocation:location
completionHandler:^(NSArray* placemarks, NSError* error) {
for (CLPlacemark *placemark in placemarks) {
NSLog(@"addressDictionary : %@", [placemark.addressDictionary description]);
NSLog(@"name : %@", placemark.name);
NSLog(@"thoroughfare : %@", placemark.thoroughfare);
01:import java.util.Hashtable;
02:
03:public class HashSearch {
04:
05: public static int exec(Hashtable vals, int target) {
06: if (vals.containsKey(target)) {
07: return (Integer) vals.get(target);
08: } else {
09: return -1;
10: }
@neiraza
neiraza / 0_reuse_code.js
Created August 28, 2014 00:49
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@neiraza
neiraza / FirstViewController.m
Created February 21, 2014 07:12
Storyboardのsegueでパラメタ受け渡したった ref: http://qiita.com/neiraza/items/6eba4e57dffa993b4933
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
if ([segue.identifier isEqualToString:@"openChatView"]) {
SecondViewController *controller = segue.destinationViewController;
controller.name = @"neiraza";
}
}
@neiraza
neiraza / OpenSettingForTwitter.m
Created February 18, 2014 06:26
端末の設定画面(Twitter)へ飛ばしたい ref: http://qiita.com/neiraza/items/9cf827dc7585bbc366c2
- (void)viewDidLoad
{
SLComposeViewController *tweetSheet = [SLComposeViewController composeViewControllerForServiceType:SLServiceTypeTwitter];
tweetSheet.view.hidden = YES;
[self presentViewController:tweetSheet animated:NO completion:^{
[self dismissViewControllerAnimated:NO completion:nil];
}];
}
@neiraza
neiraza / BlockSample.h
Created February 17, 2014 11:54
blockでコールバックを書く ref: http://qiita.com/neiraza/items/e54947e435751d965a2b
#import <Foundation/Foundation.h>
typedef void (^BlockSampleCallBack)(NSArray *foo);
@interface BlockSample : NSObject
- (void)hoge:(NSString *)fuga callback:(BlockSampleCallBack)callback;
@end
@neiraza
neiraza / file0.txt
Created February 17, 2014 11:51
Twitterのcreated_atを素敵なNSStringにした ref: http://qiita.com/neiraza/items/ea78899d617e523b5e2d
Mon Feb 17 11:36:30 +0000 2014
CGFloat lat, lng;
CLLocationCoordinate2D coordinate = CLLocationCoordinate2DMake(lat,lng);
@neiraza
neiraza / AppDelegateよびだし
Created February 12, 2014 15:02
AppDelegateを呼び出すお決まり文
HogeAppDelegate *appDelegate = (HogeAppDelegate *)[[UIApplication sharedApplication] delegate];