Skip to content

Instantly share code, notes, and snippets.

@ysaito8015
ysaito8015 / file0.txt
Last active May 30, 2019 16:10
Heroku Container Registry & Runtime とは(Heroku Dev Center の私家訳) ref: https://qiita.com/ysaito8015@github/items/0d2d32a553d0414a700e
$ heroku container:login
@ysaito8015
ysaito8015 / file0.txt
Created December 1, 2017 15:43
v0.4 から v0.6 への移行時に、注意したこと ref: https://qiita.com/ysaito8015@github/items/04d7b33791d47037a169
ModelFrame(A ~ B + C, dataframe)
@ysaito8015
ysaito8015 / Vagrantfile
Created October 19, 2017 17:38
Vagrantfile coreos for jupyter-notebook
# -*- mode: ruby -*-
# # vi: set ft=ruby :
require 'fileutils'
Vagrant.require_version ">= 1.6.0"
# Make sure the vagrant-ignition plugin is installed
required_plugins = %w(vagrant-ignition)
@ysaito8015
ysaito8015 / file0.txt
Created September 20, 2017 17:45
Ubuntu 16.04 へ Oracle 11g Express Edition を入れてみた ref: http://qiita.com/ysaito8015@github/items/1b9b6c528671f6593f1f
sudo aptitude install alien libaio1 unixodbc unzip
@ysaito8015
ysaito8015 / brew-cask-upgrade.sh
Last active April 2, 2017 20:43 — forked from n0ts/brew-cask-upgrade.sh
brew cask upgrade
#!/bin/bash [0/0]
set -Ceu
for c in $(brew cask list); do
info=$(brew cask info $c)
installed_ver=$(echo "$info" |awk 'NR==1' |cut -d" " -f 2)
current_ver=$(echo "$info" |awk 'NR==3' | cut -d" " -f 1 | rev |cut -d"/" -f 1| rev)
if [ "$current_ver" == "latest" ]; then
echo "$c is installed '$installed_ver', current is '$current_ver'"
echo -n "upgrade?[y/n]>"
var gulp = require('gulp');
var connect = require('gulp-connect');
var modRewrite = require('connect-modrewrite');
var runSequence = require('run-sequence');
var shell = require('gulp-shell');
//proxy all requests to /api to localhost:3000 for rails api
gulp.task('connect', function(){
connect.server({
root: './app',
@ysaito8015
ysaito8015 / file4.txt
Last active August 29, 2015 14:16
Heroku で ransack による日付一致検索 ref: http://qiita.com/ysaito8015@github/items/66b1985f695da4efc528
app[web.1]: Parameters: {"utf8"=>"✓", "q"=>{"order_date_cont"=>"2015-03-02"}}
app[web.1]: Purchase Load (4.9ms) SELECT DISTINCT "purchases".* FROM "purchases" WHERE ("purchases"."order_date" ILIKE '%2015-03-02%') ORDER BY "purchases"."order_date" DESC
app[web.1]: PG::UndefinedFunction: ERROR: operator does not exist: date ~~* unknown
app[web.1]: LINE 1: ... FROM "purchases" WHERE ("purchases"."order_date" ILIKE '%20...
app[web.1]: ^
app[web.1]: HINT: No operator matches the given name and argument type(s). You might need to add explicit type casts.
app[web.1]: SELECT DISTINCT "purchases".* FROM "purchases" WHERE ("purchases"."order_date" ILIKE '%2015-03-02%') ORDER BY "purchases"."order_date" DESC
app[web.1]: Rendered shared/_search_result_box.html.erb(6.9ms)
app[web.1]: Completed 500 Internal Server Error in 69ms
@ysaito8015
ysaito8015 / file0.sh
Last active August 29, 2015 14:15
Heroku Scheduler で月一回だけ実行したい ref: http://qiita.com/ysaito8015@github/items/578f7ebd6bfe3fb00d4e
[ $(date +%d) = 01 ] && ruby ./batch.rb #毎初日に実行
#確率密度(対数正規分布 平均log=5,sdlog=1.5 )で
#当選番号は1から600の間から60こ抽出
sample(600,60,prob=dlnorm(1:600, meanlog=5, sdlog=1.5))
#/usr/bin/env bash
set -e
set -x
apt-get update
apt-get upgrade
apt-get -y install build-essential curl git-core openssl libreadline6 libreadline6-dev \
zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev \