Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
# talib install script for kaggle
(
cd /tmp
wget https://artiya4u.keybase.pub/TA-lib/ta-lib-0.4.0-src.tar.gz
tar -xvf ta-lib-0.4.0-src.tar.gz
cd ta-lib
./configure --prefix=/usr
// nuxt module
// serialize server side rendering to prevent singleton problem like https://github.com/vuex-orm/vuex-orm/issues/514
let seq = 1
let lockPromise
const auxData = new WeakMap()
const lock = async (data) => {
while (lockPromise) {
console.log('serial-render waiting')
@contribu
contribu / sysbench on 12 core conoha (1 thread)
Created October 1, 2018 20:54
メモリベンチマーク
sysbench --test=memory run
sysbench 0.4.12: multi-threaded system evaluation benchmark
Running the test with following options:
Number of threads: 1
Doing memory operations speed test
Memory block size: 1K
Memory transfer size: 102400M
# clone tutorial repository
git clone git@github.com:ai-mastering/tutorial-ruby.git
cd tutorial-ruby
# install dependencies
bundle install
# upload test.wav, do the mastering, and download the output as output.wav
bundle exec ruby main.rb --input test.wav --output output.wav
#!/bin/bash
# License of this script: CC0
# Installation of dependent libraries and softwares is required to use this script
# ex. nasm, yasm, libmp3lame-dev, libopus-dev, libvorbis-dev, libvpx-dev...
set -ex
# setup
temp_dir=$(mktemp -d)
@contribu
contribu / new_safe_hash.rb
Created August 3, 2016 12:51
new_safe_hash.rb (multidimensional hash)
def new_safe_hash()
ifnone = lambda { |hash, key|
hash[key] = Hash.new(&ifnone)
}
Hash.new(&ifnone)
end
a = new_safe_hash()
a['x']['y'] = 3
puts a