Skip to content

Instantly share code, notes, and snippets.

@taji-taji
taji-taji / optimize-jpeg.sh
Last active August 29, 2015 14:10
jpegtran whole directory
#! /bin/sh
EXTENSIONS="jpe?g"
if [ -z "$1" ]; then
DIR="`pwd`"
else
DIR="$1"
fi
@taji-taji
taji-taji / gist:4f85c4280eb2028e7f32
Created August 8, 2015 00:20
CentOSバージョン確認
# cat /etc/system-release
CentOS release 6.5 (Final)
@taji-taji
taji-taji / install_go.sh
Created August 8, 2015 00:36
Install Golang
$ cd /usr/local/src
$ sudo wget https://storage.googleapis.com/golang/go1.4.2.linux-amd64.tar.gz
$ sudo tar -C /usr/local -xzf go1.4.2.linux-amd64.tar.gz
$ export PATH=$PATH:/usr/local/go/bin
@taji-taji
taji-taji / file0.go
Last active September 5, 2015 08:05
【Go】Goのsort.SearchInts()はPHPのin_array()とは全然違った! ref: http://qiita.com/taji-taji/items/ce0ac16adb880fd807b5
package main
import (
"fmt"
"sort"
)
func main() {
a := []int{1,9,3,7,5}
// まずソートする
@taji-taji
taji-taji / file0.txt
Last active September 17, 2015 03:21
【Go】Go 1.3 から 1.5 へのアップデートでエラー ref: http://qiita.com/taji-taji/items/4c43e126e67d65a219e3
$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=12.04
DISTRIB_CODENAME=precise
DISTRIB_DESCRIPTION="Ubuntu 12.04 LTS"
$ arch
x86_64
@taji-taji
taji-taji / file1.txt
Last active September 18, 2015 09:35
【Go】 go fmt でコード整形 ref: http://qiita.com/taji-taji/items/6d286bf4483a4c6ceed6
go fmt test.go
@taji-taji
taji-taji / file1.txt
Last active September 22, 2015 09:00
【ソートアルゴリズム】今さらだけどソートを復習しよう(バブルソート) ref: http://qiita.com/taji-taji/items/62db3bcf538400adc1e9
ソート前の値: [6 4 2 7 9 0 5 3 1 8]
1巡目
[6 4 2 7 9 0 5 3 (1) (8)]
[6 4 2 7 9 0 5 (3) (1) 8] > 入れ替え!
[6 4 2 7 9 0 (5) (1) 3 8] > 入れ替え!
[6 4 2 7 9 (0) (1) 5 3 8]
[6 4 2 7 (9) (0) 1 5 3 8] > 入れ替え!
[6 4 2 (7) (0) 9 1 5 3 8] > 入れ替え!
[6 4 (2) (0) 7 9 1 5 3 8] > 入れ替え!
[6 (4) (0) 2 7 9 1 5 3 8] > 入れ替え!
@taji-taji
taji-taji / file0.go
Last active October 3, 2015 09:13
【Go】import 書き方まとめ ref: http://qiita.com/taji-taji/items/5a4f17bcf5b819954cc1
import "./model"
@taji-taji
taji-taji / file0.swift
Created December 6, 2015 10:08
【Swift】特定のカスタムViewController内でステータスバーを隠す設定を書く【メモ】 ref: http://qiita.com/taji-taji/items/13aaf4a8cebb3b6e48d2
class MyCustomViewController: UIViewController {
// ~略~
override func prefersStatusBarHidden() -> Bool {
return true
}
// ~略~
@taji-taji
taji-taji / file0.swift
Last active December 19, 2015 07:17
【Swift】作成済みのUIColorのalpha値のみを変えたい ref: http://qiita.com/taji-taji/items/f3681d15a5f6d7a79e06
let redColor = UIColor.redColor()
let transparentRedColor = redColor.colorWithAlphaComponent(0.6)