Skip to content

Instantly share code, notes, and snippets.

View toguri's full-sized avatar

toguri toguri

View GitHub Profile
//直列かつ同期
dispatch_sync(dispatch_queue_create("sample", DISPATCH_QUEUE_SERIAL), ^{
});
// 並列かつ同期
dispatch_sync(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
});
//直列かつ非同期
dispatch_async(dispatch_get_main_queue(), ^{
@toguri
toguri / decode.sh
Created February 10, 2016 10:46
1行毎にブツブツとやってく
#!/bin/sh
filename=$1
cat ${filename} | while read line
do
echo `python -c "import sys, urllib as ul; print ul.unquote_plus('${line}')"`
done
@toguri
toguri / ss.js
Created January 23, 2016 07:46
casperSS
var casper = require('casper').create();
var url = casper.cli.get(0);
var savePath = casper.cli.get(1);
var milsec = new Date().getTime();
var saveFile = savePath + "/" + milsec + ".png";
casper.start();
casper.userAgent('Mozilla/5.0 (iPhone; CPU iPhone OS 7_0 like Mac OS X) AppleWebKit/537.51.1 (KHTML, like Gecko) Version/7.0 Mobile/11A465 Safari/9537.53');
casper.viewport(750, 1334);
casper.open(url);
@toguri
toguri / gist:5b9c8c6f9d07ad7e7438
Created February 20, 2015 04:16
Vimで.gradleをシンタックスハイライトさせるワンライナー
echo 'au BufRead,BufNewFile *.gradle set filetype=groovy' > ~/.vim/ftdetect/gradle.vim
@toguri
toguri / MainActivity.java
Created January 29, 2015 01:44
JSON作成時に、特定の機種のみで発生してたこと
public class MainActivity extends ActionBarActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
/*
JSON作成時に、特定の機種のみで発生してたこと
- (void) cleanUIWebView {
self.dataDetectorTypes = UIDataDetectorTypeNone;
self.delegate = nil;
[self loadHTMLString:@"" baseURL:nil];
[self stopLoading];
[self removeFromSuperview];
[[NSURLCache sharedURLCache] removeAllCachedResponses];
}