Skip to content

Instantly share code, notes, and snippets.

View akiraak's full-sized avatar

Akira Kozakai akiraak

View GitHub Profile
package main
import (
"fmt"
"github.com/PuerkitoBio/goquery"
"io/ioutil"
"strconv"
"strings"
"time"
)
# -*- coding:utf-8 -*-
import time
from lxml import objectify
class ImageInfo:
def __init__(self):
self.url = ''
self.width = ''
self.height = ''
package main
import (
"fmt"
"github.com/DDRBoxman/go-amazon-product-api"
"github.com/PuerkitoBio/goquery"
"io/ioutil"
"os"
"strings"
"time"
@akiraak
akiraak / file0.sh
Last active April 22, 2016 07:27
TensorFlow 0.8 GPU 版を Ubuntu 14.04 にインストール ref: http://qiita.com/akiraak/items/1c7fb452fb7721292071
$ sudo dpkg -i cuda-repo-ubuntu1404-7-5-local_7.5-18_amd64.deb
$ sudo apt-get update
$ sudo apt-get install cuda
@akiraak
akiraak / file0.txt
Last active March 15, 2016 12:40
高速化のため Slick2 で SQL に書きなおしたときの手法 ref: http://qiita.com/akiraak/items/b9b66ae66799720b16fd
import play.api.db.slick._
import scala.slick.jdbc.{StaticQuery => Q}
// 全てのユーザーの id を返す
def users(): List[Int] = {
DB withSession {
Q.queryNA[Int]("""
select id from users
""").list
}
$ ./watch_rsync
---- watch_rsync ----
#!/bin/sh
fswatch --exclude="/.git/" --exclude="/target/" -x ../ | xargs -I "file_path" ./conv_rsync_path.py "file_path"
---- watch_rsync ----
---- conv_rsync_path.py ----
#!/usr/bin/python
# -*- coding: utf-8 -*-
@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
@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: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
sudo yum install libxml2-devel.x86_64
sudo yum install libxslt-devel.x86_64
sudo easy_install-2.6 lxml