Skip to content

Instantly share code, notes, and snippets.

View rinx's full-sized avatar
🍵
Drinking sencha all the time

Rintaro Okamura rinx

🍵
Drinking sencha all the time
View GitHub Profile
@rinx
rinx / animation.pdf
Last active November 26, 2016 11:24
animation sample of beamer with TikZ
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@rinx
rinx / sushi-soku-enzan.hs
Created September 30, 2016 08:32
sushi-soku-enzan
--
-- 🍣-soku-enzan.hs
--
(🍣) = (+)
(🍣🍣) = (-)
(🍣🍣🍣) = (*)
(🍣🍣🍣🍣) = (/)
main :: IO ()
@rinx
rinx / test.rb
Created July 29, 2016 13:31
tsv reader
require 'csv'
filename = "test.tsv"
# read original_records into hash
original_records = []
headers = []
CSV.read(filename, :col_sep => "\t", headers: false).each_with_index do |row, i|
if i == 0 then
headers = row
next
@rinx
rinx / mc1drad_mwc.hs
Last active June 25, 2017 08:32
monte carlo 1d radiative transfer code written in haskell using random-mwc package.
import System.Random.MWC
np = 1000000
tau = 1.0 -- cloud optical thickness
sal = 0.5 -- surface albedo
omg = 1.0 -- single scattering albedo
zu = tau -- atmosphere upper boundary
zb = 0.0 -- atmosphere lower boundary
@rinx
rinx / mc1drad.hs
Last active May 5, 2016 03:00
monte carlo 1d radiative transfer code written in haskell
{-# LANGUAGE ExtendedDefaultRules, NoMonomorphismRestriction #-}
import Conduit
np = 10000
tau = 1.0 -- cloud optical thickness
sal = 0.5 -- surface albedo
omg = 1.0 -- single scattering albedo
zu = tau -- atmosphere upper boundary
zb = 0.0 -- atmosphere lower boundary
@rinx
rinx / upload_to_gdrive.lua
Created February 21, 2016 10:07
flashair to google drive v3
local cjson = require "cjson"
-- Basic account info
local client_id = ""
local client_secret = ""
local refresh_token = ""
local boundary = "--61141483716826"
local function checkWlanConnect()
@rinx
rinx / wpchange.plist
Created February 8, 2016 11:42
iTerm2 wallpaper changer job
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>iterm_wpchange</string>
<key>ProgramArguments</key>
<array>
<string>/bin/sh</string>
<string>/Users/okamura/.iterm_wp/wpchange.sh</string>
@rinx
rinx / wpchange.sh
Last active February 8, 2016 11:42
iTerm2 wallpaper changer
#!/bin/sh
CMDNAME=`basename $0`
BASE_DIR=$(cd $(dirname $0);pwd)
image_list=(${BASE_DIR}/*.jpg)
numimglist=${#image_list[@]}
rannum=$(( $RANDOM % ${numimglist}))
image_path=${image_list[$rannum]}
@rinx
rinx / upload_to_gdrive.lua
Created February 6, 2016 13:46
flashair to google drive with apiv3
local cjson = require "cjson"
-- Basic account info
local client_id = ""
local client_secret = ""
local refresh_token = ""
local boundary = "--61141483716826"
local function getAuth()
@rinx
rinx / plot.rb
Created February 6, 2016 06:32
gnuplot gem heatmap test
#!/usr/bin/env ruby
# -*- coding: utf-8 -*-
#
# plot-3d-ipa.rb
#
# Author:
# Rintaro Okamura
#
# Requires ruby-netcdf