Skip to content

Instantly share code, notes, and snippets.

View keichi's full-sized avatar

Keichi Takahashi keichi

View GitHub Profile
@keichi
keichi / patch.diff
Created February 4, 2014 08:14
Patch to pandoc for tweaking table stype
--- pandoc-1.12.3/src/Text/Pandoc/Writers/LaTeX.hs 2014-01-11 04:17:42.000000000 +0900
+++ pandoc-1.12.3-new/src/Text/Pandoc/Writers/LaTeX.hs 2014-02-04 17:09:32.000000000 +0900
@@ -456,7 +456,7 @@
blockToLaTeX (Table caption aligns widths heads rows) = do
headers <- if all null heads
then return empty
- else ($$ "\\midrule\\endhead") `fmap`
+ else ($$ "\\hline\\hline\\endhead") `fmap`
(tableRowToLaTeX True aligns widths) heads
captionText <- inlineListToLaTeX caption
@keichi
keichi / gist:c61e09051a55cc47feca
Created May 20, 2014 00:06
Parse float with binary-parser
var Parser = require('binary-parser').Parser;
var testParser = new Parser().float('floatValue');
var buffer = new Buffer("41A00000","hex");
var parsed = testParser.parse(buffer);
console.log(parsed.floatValue);
@keichi
keichi / main.cpp
Created June 2, 2014 05:48
Formatting string with std::stringstream
#include <iostream>
#include <sstream>
int main() {
std::stringstream ss;
int pid = 123;
ss << "/proc/" << pid << "/stat/";
std::cout << ss.str() << std::endl;
@keichi
keichi / gist:ebbf400abf19be1e8772
Created August 13, 2014 02:19
One-liner for fish shell to update applications installed with homebrew-cask
for app in (brew cask list); if brew cask info $app | grep -qF "Not installed"; brew cask install $app; end ; end
@keichi
keichi / gist:f26f9b8a24732b48b84b
Created May 14, 2015 02:12
Upload file to ownCloud & Generate public link
var request = require("request");
var xml2js = require("xml2js");
var fs = require("fs");
var path = require("path");
var OWNCLOUD_USER = "XXX";
var OWNCLOUD_PASSWD = "XXX";
var OWNCLOUD_WEBDAV_EP = "https://XXX.YYY/remote.php/webdav";
var OWNCLOUD_UPLOAD_PATH = "/path/to/directory";
var OWNCLOUD_OCS_SHARE_EP = "https://XXX.YYY/ocs/v1.php/apps/files_sharing/api/v1/shares"
@keichi
keichi / build_dictionary.cpp
Last active August 29, 2015 14:25
Novel aauthor classification using Weka ("Big Data Engineering" assignment)
#include <iostream>
#include <algorithm>
#include <cmath>
#include <map>
#include <fstream>
#include <sstream>
#include <mecab.h>
#include <dirent.h>
#include <set>
#cloud-config
hostname: deis.keichi.net
coreos:
update:
reboot-strategy: best-effort
units:
- name: docker.service
command: start

Keybase proof

I hereby claim:

  • I am keichi on github.
  • I am keichi (https://keybase.io/keichi) on keybase.
  • I have a public key whose fingerprint is 398A FBEE ACE4 914C 792F 62F9 E032 0357 B24E E5ED

To claim this, I am signing this object:

BEGIN:VCALENDAR
PRODID:Everyday Gomi
VERSION:2.0
METHOD:PUBLISH
CALSCALE:GREGORIAN
X-WR-CALNAME:ごみカレンダー
X-WR-CALDESC:ゴミの日の情報を配信します
X-WR-TIMEZONE:Asia/Tokyo
BEGIN:VEVENT
UID:gomi/20160401
@keichi
keichi / mm1_sim.py
Created December 15, 2016 04:10
M/M/1 Queue Simulator
import heapq
from functools import total_ordering
from random import expovariate
EVENT_ARRIVED = 0
EVENT_LEFT = 1
@total_ordering