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
main :: IO()
main = mapM_ print $ prime 10000
prime :: Int -> [Int]
prime n = primeList [2..n]
where
primeList [] = []
primeList (x:xs) = x:primeList [ y | y <- xs, y `mod` x /= 0 ]
@rinx
rinx / othello.hs
Last active December 22, 2015 15:58
Haskellでオセロ。2013年度前期の大学の課題ではない。(元ネタ: https://gist.github.com/oboenikui/6297337)
-- othello.hs
--
-- To run...
-- Prelude> control initialBoard initialTurn
--
-- controls...
-- cursor keys => move cursor
-- Z key => put stones
-- P key => pass the turn
-- Q key => quit
@rinx
rinx / markdown2reveal
Last active December 23, 2015 02:39
convert markdown to reveal.js via pandoc
#!/bin/sh
#
# convert markdown to reveal.js via pandoc
#
# this script requires...
# git, pandoc
#
# Usage...
# $ markdown2reveal -o output.html input.md
#!/bin/bash
# This script gets weather charts from www.jma.go.jp
DIRNM=`date +"WC_%Y%m%d_%I%M"`
mkdir -p ${DIRNM}
cd ${DIRNM}
# -- asas,fsas24,fsas48
wget http://www.jma.go.jp/jp/g3/images/asia/pdf/asas.pdf >> log 2>&1 && echo "asas downloaded successfully!"
@rinx
rinx / TBI-with-d.hs
Last active December 26, 2015 23:49
薄膜干渉のシミュレーションするやつ
{-
波長lambdaは380nm-1500nm程度として計算する。
媒質の屈折率n1は1.5として考える。
-}
import System.IO
main :: IO ()
main = mapM_ simulate [0.1,0.3,0.4,0.5,0.6,0.7,1.0]
#!/bin/sh
for i in {0..255}
do
printf "\x1b[38;5;${i}m%03d " ${i}
done
printf "\n"
@rinx
rinx / Makefile
Last active January 1, 2016 23:48
Makefile template for lualatex document
#
# Makefile template for lualatex document
#
# Please set target name
target=name
OS=${shell uname}
$(target).pdf: lualatex.fmt $(target).tex
lualatex $(target).tex
@rinx
rinx / letters.txt
Last active January 1, 2016 23:48
なんかかわいい文字たち
🔙
setl conceallevel=0
#!/usr/bin/env ruby
#-*- coding: utf-8 -*-
require 'twitter'
# --- define consts ---
CONSUMER_KEY = ''
CONSUMER_SECRET = ''
ACCESS_TOKEN = ''