Skip to content

Instantly share code, notes, and snippets.

@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 / 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);
@sousk
sousk / TouchEventDispatcher.js
Created December 26, 2014 05:30
Dispatching touch events between HTML which contains iframe and the document of that iframe
/**
@license WTFPL
@author @sou
This library dispatches touch events from an element to another on the different document through iframe.
NOTE:
This library only suports Mobile Safari as each browsers have different specifications for touch event creation.
You might expand _dispatch method if you want to deal with other browsers.
let bin = System.IO.File.ReadAllBytes "../../test"
let mutable i = 0
let show len asm =
printf "%08X " i
for j = 0 to len - 1 do
printf "%02X" bin.[i + j]
for j = len to 5 do
printf " "
printfn "%s" asm
i <- i + len