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 / view.html
Last active August 29, 2015 14:05
visualize a timecard data using d3.js
<!DOCTYPE html>
<meta charset="utf-8">
<style>
body {
font: 10px sans-serif;
shape-rendering: crispEdges;
}
.day {
@rinx
rinx / csvtotextable.vim
Created August 23, 2014 07:45
convert csv to tex-table style
"A function to convert csv to tex table
function! s:csv_to_tex_table() range
let lines = getline(a:firstline, a:lastline)
let spacelen = []
let maxrownum = 0
let maxcollen = []
let values = []
for i in range(0, a:lastline - a:firstline)
let linespacelen = []
call add(values, split(substitute(lines[i], '\s*\,\s*', ',', 'g'), ','))
@rinx
rinx / tweetcmd.rb
Created August 14, 2014 08:58
tweeting from commandline
#!/usr/bin/env ruby
# -*- coding: utf-8 -*-
require 'twitter'
CONSUMER_KEY = ''
CONSUMER_SECRET = ''
ACCESS_TOKEN = ''
ACCESS_SECRET = ''
@rinx
rinx / fizzbuzz.lisp
Created August 10, 2014 09:16
FizzBuzz with clisp
(defun fizzbuzz ()
(loop for i
below 100
do (progn
(princ (cond ((zerop (mod i 15)) "FizzBuzz")
((zerop (mod i 5 )) "Buzz")
((zerop (mod i 3 )) "Fizz")
(t i)))
(fresh-line))))
@rinx
rinx / if-friday-show-beer.sh
Created August 1, 2014 01:59
if it's friday, show beer icon
#!/bin/sh
beer="\xf0\x9f\x8d\xba"
if [ `date +"%w"` == "5" ]; then
echo -n $beer | sed -e 's/^-n//'
fi
@rinx
rinx / fizzbuzz.f90
Last active August 29, 2015 14:04
fizzbuzz with fortran95
program main
integer :: i
do i = 1, 100
if (mod(i, 15) == 0) then
print *, "FizzBuzz"
elseif (mod(i, 5) == 0) then
print *, "Buzz"
elseif (mod(i, 3) == 0) then
let s:extfname = expand("%:e")
if s:extfname ==? "f90"
let fortran_free_source=1
unlet! fortran_fixed_source
else
let fortran_fixed_source=1
unlet! fortran_free_source
endif
@rinx
rinx / 0_reuse_code.js
Created May 16, 2014 16:33
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@rinx
rinx / timecard.sh
Last active August 29, 2015 14:00
ラボにチェックイン・チェックアウトするときにつかうやつ
#!/bin/sh
timecard="${HOME}/.timecard"
tweetrb="${HOME}/.bin/timecard/tweet.rb"
role=$1
today=`date "+%Y/%m/%d"`
nowtime=`date "+%H:%M:%S"`
\mode<presentation>
\usecolortheme{whale}
\usecolortheme{orchid}
\useinnertheme{rounded}
\useoutertheme{infolines}
\setbeamertemplate{headline}[default]
\definecolor{ExSkyBlue}{RGB}{4, 114, 255}