Skip to content

Instantly share code, notes, and snippets.

View KOBA789's full-sized avatar
๐Ÿš€

KOBA789 KOBA789

๐Ÿš€
View GitHub Profile
/*
Copyright ยฉ 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 furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED โ€œAS ISโ€, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
@KOBA789
KOBA789 / fizzbuzz.c
Last active August 29, 2015 14:00
fizzbuzz
/*
Simple FizzBuzz
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,
@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,
@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 / 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 / .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
#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 / 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
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);
};
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',