Skip to content

Instantly share code, notes, and snippets.

View tanshio's full-sized avatar
🤢
😭

Shota Tanno tanshio

🤢
😭
View GitHub Profile
@tanshio
tanshio / .eslintrc
Created February 28, 2016 14:48
.eslintrc
{
"env": {
"browser": true,
"node": true,
"jasmine": true,
"phantomjs": true,
"jquery": true,
"shelljs": true,
"es6": true
},
@tanshio
tanshio / file0.m
Last active October 12, 2015 22:12
UIPageContorollと拡大・ダブルタップに対応したスライドギャラリーを作る ref: http://qiita.com/tanshio/items/01cb5b25d3e9534ba07a
- (void)setUpImages {
self.itemScrollView.contentSize = CGSizeMake(self.view.frame.size.width * 3, self.view.frame.size.width);
self.itemScrollView.pagingEnabled = YES;
self.itemScrollView.showsHorizontalScrollIndicator = NO;
self.itemScrollView.showsVerticalScrollIndicator = NO;
self.itemScrollView.delegate = self;
NSURL *url = [NSURL URLWithString:@"URL"];
TOWebViewController *webViewController = [[TOWebViewController alloc] initWithURL:url];
[self.navigationController pushViewController:webViewController animated:YES];
@tanshio
tanshio / file0.m
Created October 10, 2015 00:52
Static Cells時の選択色を変更する ref: http://qiita.com/tanshio/items/26ed81d5fd15268abff4
UIView *backgroundSelectedCell = [[UIView alloc] init];
[backgroundSelectedCell setBackgroundColor:[UIColor colorWithRed:130/256.0 green:169/256.0 blue:171/256.0 alpha:1.0]];
for (int section = 0; section < [self.tableView numberOfSections]; section++)
for (int row = 0; row < [self.tableView numberOfRowsInSection:section]; row++)
{
NSIndexPath* cellPath = [NSIndexPath indexPathForRow:row inSection:section];
UITableViewCell* cell = [self.tableView cellForRowAtIndexPath:cellPath];
@tanshio
tanshio / big.m
Created October 9, 2015 23:21
ビッグエンディアンに変換
int i =NSSwapHostIntToBig(1);
NSData *test = [NSData dataWithBytes:&i length:sizeof(i)];
@tanshio
tanshio / big.m
Created October 9, 2015 23:20
ビッグエンディアンに変換
int i =NSSwapHostIntToBig(1);
NSData *test = [NSData dataWithBytes:&i length:sizeof(i)];
@tanshio
tanshio / main.h
Created October 5, 2015 22:32
下階層
SearchNavigationController *searchNavView = [self.storyboard instantiateViewControllerWithIdentifier:@"SEARCH"];
SearchViewController *searchView = (SearchViewController *)searchNavView.visibleViewController;
searchView.menuFlag = TRUE;
@tanshio
tanshio / picker.h
Created October 4, 2015 16:16
Picker
///
// ExhibitViewController.h
// auction
//
// Created by TannoShota on 2015/09/28.
// Copyright (c) 2015年 TannoShota. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "DownPicker.h"
@tanshio
tanshio / char.m
Last active October 2, 2015 07:45
char
char index = 30;
NSData *data = [NSData dataWithBytes:&index length:sizeof(index)];
NSMutableData *md = [NSMutableData alloc];
[md appendData:data];
function myFunction() {
var response = UrlFetchApp.fetch("https://www.google.co.jp/search?q=バッグ&num=100");
var arr = [];
var myRegexp = /<h3 class=\"r\">([\s\S]*?)<\/h3>/gi;
var elems = response.getContentText().match(myRegexp);
for(var i in elems) {
var title = elems[i];
var site = [];