timezone を変更
sudo timedatectl set-timezone UTC
timezone の一覧を確認
timedatectl list-timezones
timezone を変更
sudo timedatectl set-timezone UTC
timezone の一覧を確認
timedatectl list-timezones
require 'csv' | |
require 'json' | |
lines = readlines.join('') | |
json = JSON.parse(lines) | |
puts json.first.map{ |k,v| k }.join(',') | |
json.each do |node| | |
puts node.map { |k,v| v }.join(',') | |
end |
git fetch origin | |
git reset --hard origin/master |
brew info postgresql | |
``` | |
/usr/local/Cellar/postgresql/9.5.4 (3,147 files, 35MB) | |
Poured from bottle on 2016-09-05 at 10:59:38 | |
/usr/local/Cellar/postgresql/9.6.2 (3,251 files, 36.5MB) * | |
Poured from bottle on 2017-03-13 at 13:20:21 | |
``` | |
mkdir /usr/local/var/postgres9.6.2 |
{def f(a:Int,n:Int,m:Int):Stream[Int]=if(a==m)f(a+n,n+1,m+1)else m #::f(a,n,m+1) | |
f(1,2,1)}.takeWhile(_<101).foreach(println) |
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Splite Animation Sample</title> | |
<script type="text/javascript" src="splite.js"></script> | |
</head> | |
<body> | |
<div id="canvasDiv"></div> | |
</body> | |
</html> |
# ffmpegで動画のキャプチャを取得 | |
ffmpeg -i input.mp4 -s 320x180 -r 10 -f image2 output-%03d.jpeg | |
# ImageMagickで画像を連結 | |
convert -append output-*.jpeg conncat.jpeg |
// state machine | |
var stm = { | |
'stateA': { | |
events: { | |
'ev1': function(){ | |
this.state = 'stateB'; | |
// a certain action | |
}, | |
'ev2': function(){ | |
this.state = 'stateC'; |
def fib(n) | |
return 0 if n == 0 | |
return 1 if n == 1 | |
fib(n - 1) + fib(n - 2) | |
end | |
def fib2(n) | |
fib_iter2(1, 0, n) | |
end |
require 'thread' | |
queue = Queue.new | |
(1..1000).each { |i| queue.push i } | |
threads = [] | |
concurrency = 5 | |
concurrency.times do |thread_id| | |
threads << Thread.new(thread_id) { |id| | |
until queue.empty? |