Skip to content

Instantly share code, notes, and snippets.

@sousk
sousk / gist:243778
Created November 27, 2009 02:05
install imagemagick on Mac OSX
# install imagemagick on OSX
$ sudo port install ImageMagick
$ pecl download imagick
WARNING: channel "pecl.php.net" has updated its protocols, use "pecl channel-update pecl.php.net" to update
downloading imagick-2.3.0.tgz ...
Starting to download imagick-2.3.0.tgz (86,976 bytes)
.....................done: 86,976 bytes
File /Users/tumf/tmp/imagick-2.3.0.tgz downloaded
/Users/tumf/tmp%
$ tar xvzf imagick-2.3.0.tgz
@sousk
sousk / fish.fish
Last active April 23, 2019 02:20
memorize git commands
// graph
git log -10 --oneline --graph origin/develop
// diff
git log -p
@sousk
sousk / fish.fish
Created April 22, 2019 07:35
Update golang docker image
sed -i '' 's/golang:1.12.1/golang:1.12.4/' (ack -l golang:1.12.1)
@sousk
sousk / fish.fish
Created April 22, 2019 07:34
dump SQL select into CSV with gcolud spanner command
gcloud spanner databases execute-sql dbname --instance=instance-name --project=project-name --format=json --sql=(cat query.sql | ruby -e 'STDIN.select{|l| ! l.match /^[\s\t]*--/ }.each{|l| print l.chomp, " "}') | jq -r '.rows[] | map(.[0]) | map("\"" + . + "\"") | join(",")' > result.csv
@sousk
sousk / client_test.go
Last active March 12, 2018 07:59
Test code to reproduce a mercari/datastore's bug
package aedatastore
import (
"testing"
"time"
"google.golang.org/appengine"
"google.golang.org/appengine/aetest"
)
import krakenex
import fx
import time
import urllib.request
import urllib.parse
import json
from pprint import pprint
##Kraken パブリックapiのキー
@sousk
sousk / script.txt
Created September 13, 2017 02:56
Presentation Script
My dream is to live a quiet daily life with my partner and my cat.
Living in a small but comfortable house on the seaside, where I can see beautiful sunset and morning light every day,
enjoy diving on a sunny day, and reading books or studying food and drinks when it rains.
It's kind of my dream.
And I want to be full-filled, as well as I wanna have a happy life.
Full-filled,
I gotta being full-filled when I gotta a-ha or eureka moment on my work.
It comes from the moment when I feel the impact that I can solve some problems, improve something essentially, make something better, especially the place where we live. I love to improve a daily life of others.
@sousk
sousk / .tmux.conf
Last active May 3, 2017 10:14
tmux.conf
set-option -g mouse on
# ** Wheel scroll in pane
unbind -T root WheelUpPane
unbind -T root WheelDownPane
# Do mouse wheel-up to enter copy mode and do page-up
# https://groups.google.com/d/msg/tmux-users/XTrSVUR15Zk/3iyJLMyQ7PwJ
# Below binding did not work
# bind -T root WheelUpPane if -Ft= '#{mouse_any_flag}' 'if -Ft= "#{pane_in_mode}" "copy-mode -u" "send-keys -M"' 'copy-mode -u'
# Below works and allows the WheelUpPane binding in emacs-copy table to be effective
@sousk
sousk / jquery_deferred_chains.js
Created March 17, 2011 10:06
combine multiple chains with jQuery.Deferred
$.when(
sushi_roll(),
dispatch()
).done(function() {
console.log('accepted:', arguments[0], arguments[1]);
});
var n = 0;
function dispatch() {
return $.Deferred(function(dispached) {
@sousk
sousk / enviromment.js
Created March 19, 2016 00:44
Emoji Label Generator for Runscope Testing
var ust = (function(t) { return [t.getMonth() +1,"/",t.getDate(),'/',t.getHours()].join(''); })(new Date());
var syms = ['🐈','🍣','🍺','🐈','🍣','🍺','🍷','🍮','🐄','🍶','⚽️','🍕'];
var label = ust + (_(5).times(function() { return syms[(_.random(0, syms.length))]; })).join(' ');
variables.set("label", label);