Skip to content

Instantly share code, notes, and snippets.

View makotom's full-sized avatar
👋
Huomiseen. Bye.

Makoto Mizukami makotom

👋
Huomiseen. Bye.
View GitHub Profile
@makotom
makotom / gist:5791750
Created June 16, 2013 11:17
Convert readom CDDA image to wav file
dd conv=swab if=ORIGINAL_BIN of=TMP_BIN
mplayer -demuxer rawaudio -ao pcm:file=WAVE TMP_BIN
@makotom
makotom / bingo.html
Last active December 19, 2015 08:29
Let's bingo. :P
<!doctype html>
<meta charset="UTF-8">
<title>Numbers</title>
<style>
#hitbox{
font-size: 400px;
text-align: center;
}
#stackbox{
@makotom
makotom / countdown.html
Created July 4, 2013 11:24
Countdown timer with music
<!doctype html>
<meta charset="UTF-8">
<title>Numbers</title>
<style>
#countbox{
font-size: 400px;
text-align: center;
}
#countbar{
@makotom
makotom / parse_str.js
Last active December 20, 2015 11:29
Another JS implementation to parse query strings
function parseStr(str) {
"use strict";
var ret = {};
str.toString().split("&").forEach(function (term) {
var eqSplit = term.split("="),
fieldName = decodeURIComponent(eqSplit.shift());
if (fieldName === "") {
@makotom
makotom / pi.js
Created August 12, 2013 15:17
JS Benchmark using Gauss–Legendre
(function(){
"use strict";
var n = 100000,
init = function(){
return {
a : 1,
b : 1 / Math.sqrt(2),
t : 1 / 4,
@makotom
makotom / piw.js
Created August 13, 2013 04:55
pi.js for JScript
(function(){
"use strict";
var n = 100,
init = function(){
return {
a : 1,
b : 1 / Math.sqrt(2),
t : 1 / 4,
@makotom
makotom / jsurandom.js
Created September 5, 2013 05:50
JS random string generator
(function(){
"use strict";
var URANDSRC = "/dev/urandom",
getUrandomInt8 = (function(){
var fs = require("fs"),
urandom = fs.openSync(URANDSRC, "r"),
buf = new Buffer(1);
@makotom
makotom / ntpInfo.js
Created April 28, 2014 09:17
Basic script to handle JSON from ntp.nict.jp
(function(){
var SERVERS = [
"http://ntp-a1.nict.go.jp/cgi-bin/jsont",
"http://ntp-b1.nict.go.jp/cgi-bin/jsont"
],
http = require("http");
(function(){
var jsont = function(body){
return body;
@makotom
makotom / ntp.js
Last active April 10, 2019 01:03
Client implementation for JSON time service by ntp.nict.jp
(function(){
var SERVERS = [
"http://ntp-a1.nict.go.jp/cgi-bin/jsont",
"http://ntp-b1.nict.go.jp/cgi-bin/jsont"
],
http = require("http");
(function(){
var Server = function(serverName){
var responseOn = 0,
/*
* Do fclose(fd).
* Filenames should not be hidden.
That's all. Tested on Win2012R2 + 4 kB NTFS + VS2013.
*/
#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>