Skip to content

Instantly share code, notes, and snippets.

View KOBA789's full-sized avatar
🚀

KOBA789 KOBA789

🚀
View GitHub Profile
var http = require('http'),
fs = require('fs');
var i = Date.now();
function run () {
http.request({
//host: '199.96.57.7',
//host: '117.18.237.139',
host: 'cs90.wac.edgecastcdn.net',
function EOF () {}
function State (list) {
this._pos = 0;
this._list = Array.prototype.slice.call(list).concat([EOF]);
}
State.prototype.getList = function () {
return this._list.slice(this._pos);
};
@KOBA789
KOBA789 / getIssuerName.js
Last active August 29, 2015 14:03
クレカのブランド名を取得するアレ
/*
The MIT License (MIT)
Copyright (c) <2014> <Hidekazu Kobayashi>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
int pick(int *rate, int types) {
int i = 0, max = 0, sum = 0, rnd;
for (i = 0; i < types; ++i) {
max += rate[i];
}
@KOBA789
KOBA789 / pop.js
Last active February 17, 2016 06:32
(function () {
var style = document.createElement('style');
style.appendChild(document.createTextNode('* { font-family: "HG創英角ポップ体" !important }'));
document.head.appendChild(style);
})();
@KOBA789
KOBA789 / .tmux.conf
Created May 5, 2014 16:43
tmux: IMAGINE THE FUTURE.
set -g prefix C-t
unbind-key C-b
bind-key C-t send-prefix
set -g default-terminal xterm-256color
set-option -g default-shell /bin/zsh
# powerline
set-option -g pane-active-border-fg colour54
@KOBA789
KOBA789 / powerline.el
Created May 3, 2014 18:46
Powerline for IMAGINE THE FUTURE.
;; -Powerline
(defun git-branch-mode-line ()
(let* ((branch (replace-regexp-in-string
"[\r\n]+\\'" ""
(shell-command-to-string "git symbolic-ref -q HEAD")))
(mode-line-str (if (string-match "^refs/heads/" branch)
(format " [%s]" (substring branch 11)) "")))
(propertize mode-line-str 'face 'mode-line-4-fg)))
(line-number-mode t)
@KOBA789
KOBA789 / cnv.js
Created May 1, 2014 17:17
課題を解くために作った。
/*
* This program is licensed under the MIT License.
* see: http://koba789.mit-license.org/
*
* node cnv.js 260
*/
var input = Number(process.argv[2] || 0);
var k,
@KOBA789
KOBA789 / nabeatsu.c
Last active August 29, 2015 14:00
nabeatsu
/*
Nabeatsu without string manipulations
Copyright (C) 2014 KOBA789
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,