Skip to content

Instantly share code, notes, and snippets.

View akiraak's full-sized avatar

Akira Kozakai akiraak

View GitHub Profile
javascript:(function(){var f=hs.prefs.isNewRetweet;if(f==0){f=1;alert('公式RTに変更');}else{f=0;alert('非公式RTに変更');}hs.prefs.isNewRetweet=f;$("#streamTabInfo .controls")[0].innerHTML+='<a onclick="if($(\'#hsrt\')[0].checked){hs.prefs.isNewRetweet=1;}else{hs.prefs.isNewRetweet=0};" class="addColumn btn-spl"><input type="checkbox" id="hsrt" '+((hs.prefs.isNewRetweet==1)?"checked":"")+'>&nbsp;公式RT</a>';})();
#!/usr/bin/python
import glob
import os
no = 1 # 連番の最初の数字
files = glob.glob('*.jpg')
for file in files:
file = './' + file
#!/bin/bash
left_files=(
# -90度回転させたいファイル名を列挙
0001.jpg
0002.jpg
)
right_files=(
# 90度回転させたいファイル名を列挙
@akiraak
akiraak / 画像リサイズと、連番ファイル名へリネーム
Created October 12, 2010 09:10
resize.py --width=320 --height=480 --fileoder=true --output=./out_dir src_dir/*
#!/usr/bin/env python
# -*- encoding:utf-8 -*-
from __future__ import division
import sys, os
import math
import re
from commands import getstatusoutput
from optparse import OptionParser, OptionGroup
def execute(command):
@akiraak
akiraak / "iTunes file sharing" を利用してアプリ内のファイルをXCode無しで編集
Created October 13, 2010 03:43
"iTunes file sharing" を利用してアプリ内のファイルをXCode無しで編集
NSString* fileName = @"slideshow.txt";
NSString* filePath = NULL;
#ifdef DISTRIBUTION
filePath = [[NSBundle mainBundle] pathForResource:fileName ofType:NULL];
#else
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString* documentsPath = [paths objectAtIndex:0];
filePath = [NSString stringWithFormat:@"%@/%@", documentsPath, fileName];
NSFileManager *fileManager = [NSFileManager defaultManager];
BOOL exist = [fileManager fileExistsAtPath:filePath];
@akiraak
akiraak / gist:882818
Created March 23, 2011 09:05
UIWebView でURLを表示前に画面をクリアするには about:blank を読み込ませる
[self.webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"about:blank"]]];
[self.webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:url]]];
sudo yum install libxml2-devel.x86_64
sudo yum install libxslt-devel.x86_64
sudo easy_install-2.6 lxml
@akiraak
akiraak / gist:893753
Created March 30, 2011 02:30
2010年日経平均225の株価を合計してグラフ化したもの
<html><body>
<img src="http://chart.apis.google.com/chart?cht=lc
&amp;chs=700x200
&amp;chg=8.33,50,1,5
&amp;chxt=x,y
&amp;chxl=0:|2010/1|2010/2|2010/3|2010/4|2010/5|2010/6|2010/7|2010/8|2010/9|2010/10|2010/11|2010/12|2011/1|1:|0|1203359276|2406718553
&amp;chd=t:80,33,65,72,71,41,51,56,61,49,42,44,49,44,38,54,39,47,50,66,55,58,46,69,79,44,61,82,67,58,69,44,45,70,51,59,78,48,76,94,40,42,50,40,49,92,54,41,50,49,57,40,69,64,71,57,56,77,58,60,73,46,49,53,46,52,61,44,45,73,67,76,78,66,78,82,75,52,61,55,50,59,40,35,52,45,52,95,65,52,63,59,54,57,57,61,58,32,36,78,66,44,55,46,70,57,53,43,47,50,62,81,78,73,68,68,68,46,62,58,66,70,60,70,67,55,55,69,47,51,35,50,62,66,55,60,52,39,54,45,47,50,38,55,69,54,39,47,44,65,34,43,48,49,52,57,50,42,48,62,52,58,55,59,63,51,40,38,59,50,44,74,59,56,49,47,56,59,63,54,57,44,48,80,55,42,49,43,54,50,52,50,50,36,62,48,50,57,56,53,49,47,54,60,66,80,57,58,65,51,55,57,61,50,47,52,53,52,55,42,48,42,47,83,97,71,100,54,49,43,59,58,59,71,46,69,55,68,67,59,46,61,53,37,49
&amp;chm=s,FF9904" />
</bo
@akiraak
akiraak / gist:930294
Created April 20, 2011 03:48
配列の添字にマイナスを使って参照
int funcname(int i){
static const int minus[]={-2, -1};
static const int plus[]={0, 1};
#define ARRAYSIZE(x) (sizeof(x)/sizeof(x[0]))
assert(i >= -ARRAYSIZE(minus) && i < ARRAYSIZE(plus));
return plus[i];
}
@akiraak
akiraak / gist:b7c112e46b79dacfabf1
Created September 4, 2014 08:15
ingress glyph hack list
!shapers/play/calvinball
accept/human/weak
advance/civilization/pursue/shapers/path
advance/civilization/pursue/shapers/truth
advance/civilization/repeat/failure
advance/enlightenment
advance/future/not/war
advance/human/enlightenment
advance/human/resistance