Skip to content

Instantly share code, notes, and snippets.

View ikr7's full-sized avatar
🅰️
rch Linux

ikr7

🅰️
rch Linux
View GitHub Profile
@ikr7
ikr7 / bench.js
Created February 18, 2014 15:39
適当にベンチするやつ
//bench.js
var bench = function(a){
a.benches.forEach(function(e){
console.time(e.name);
for(var i = 0; i < a.count; i++){
e.func();
}
console.timeEnd(e.name);
});
@ikr7
ikr7 / chat.js
Last active August 29, 2015 13:56
ちゃっと
var WebSocket = require('ws');
var wss = new WebSocket.Server({'port': 8080});
wss.broadcast = function(data) {
this.clients.forEach(function(client){
client.send(data);
});
};
@ikr7
ikr7 / test.js
Created March 6, 2014 11:15
ど、動的型付け〜
[
true,
false,
'true',
'True',
'TRUE',
'false',
'False',
'FALSE',
null,
@ikr7
ikr7 / animegif.js
Created March 7, 2014 03:18
Node.js でアニメGIF生成
var fs = require('fs');
var Canvas = require('canvas');
var GIFEncoder = require('gifencoder');
var encoder = new GIFEncoder(320, 240);
encoder.start();
encoder.setRepeat(0);
@ikr7
ikr7 / generate.rb
Last active August 29, 2015 13:57
Ruby de 陰毛
# coding: utf-8
require 'cairo'
require './inmou.class.rb'
width = 256
height = 256
amount = 16
length = 1
@ikr7
ikr7 / sex.php
Created April 8, 2014 12:46
Foooooooooooooo
<?php
$data = json_decode(file_get_contents("https://pvp.minecraft.jp/servers.json"));
$all_players = 0;
foreach($data->servers as $server){
$all_players += $server->Server->current;
printf("%s: %d/%d, %s\n",
$server->Server->name,
@ikr7
ikr7 / helloworld
Created April 19, 2014 12:46
helloworld.js
[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]][([][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]](([][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+
@ikr7
ikr7 / bbop.js
Last active August 29, 2015 14:00
bbop.js
// github.com/ikr7/twitter_commands_v2 で bbop
// 参考: https://gist.github.com/laco0416/8ffe20bfd393e1344112
var Command = require('../lib/command.js');
var makebbop = function(){
var elements = ['ビ','ビ','ド','レ','ド','オ','ペ','レ','ショ'];
var indice = [];
var matches = 0;
elements.forEach(function(ch, i, arr){
@ikr7
ikr7 / bot.js
Created May 3, 2014 04:04
クソbot
var ImmortalNTwitter = require('immortal-ntwitter');
var twit = ImmortalNTwitter.create({
'consumer_key': '',
'consumer_secret': '',
'access_token_key': '',
'access_token_secret': ''
});
@ikr7
ikr7 / apis
Last active May 5, 2023 07:03
JPMCPvPのAPIっぽいものリスト
Json API いちらん
Base URLは
"https://pvp.minecraft.jp" または "http://api.minecraft.jp/pvp" です
"/servers.json"
サーバーの情報をいい感じに取得できます
"/servers/online.json"
現在オンラインのプレイヤー数(サイトの右上のやつ)を取得できます