Skip to content

Instantly share code, notes, and snippets.

View st98's full-sized avatar

st98 st98

View GitHub Profile
@st98
st98 / hello.il
Last active August 29, 2015 14:01
IL で書く Hello, world!
.assembly extern mscorlib {}
.assembly Hello {}
.method static void Main() cil managed {
.entrypoint
.maxstack 1
ldstr "Hello, world!"
call void [mscorlib]System.Console::WriteLine(string)
ret
}
class Barrette(object):
def __truediv__(self, other):
return other
def __lt__(self, other):
print(other)
def __str__(self):
return 'ひだまりスケッチ×365 来週も見てくださいね!'
@st98
st98 / yuno.js
Last active August 29, 2015 14:01
ゆの in JavaScript。ちょっとズル。
ReferenceError.prototype.name = 'ひだまりスケッチ×365 来週も見てくださいね!';
X / _ / X < 来週も見てくださいね
@st98
st98 / yuno.clj
Last active August 29, 2015 14:01
ゆの in Clojure?
(defn X [& _]
(println "ひだまりスケッチ×365 来週も見てくださいね!"))
(def _ nil)
(def 来週も見てくださいね! nil)
(X / _ / X < 来週も見てくださいね!)
@st98
st98 / kakenai.hsp
Last active August 29, 2015 14:01
何となく HSP を書きたくなったので。筆先が回転するお絵描きツール。
*init
screen 0, 256, 256
title "お絵かけない"
angle = 0
pressed = 0
px = 0
py = 0
@st98
st98 / mc.hsp
Last active August 29, 2015 14:01
モンテカルロ法でうんぬん。
*init
screen 0, 256, 256
title "もんかる"
num = 0
n = 0
pos 72, 120
mes "クリックで開始"
@st98
st98 / yuno.html
Created May 21, 2014 12:05
ゆの in HTML/CSS。…これはレギュレーション違反では。
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>ゆの in HTML/CSS</title>
<style>
#yuno {
font-size: 0;
}
#yuno::after {
@st98
st98 / test1.js
Last active August 29, 2015 14:01
コンソールで実行すると楽しい。
} if (1) { console.log('hoge'); // => 'hoge'
@st98
st98 / Number#times.js
Created May 27, 2014 01:20
ちょっと曲芸な感じの Number#times。リソースの無駄遣い。
Number.prototype.times = function (fn) {
Array.apply(null, { length: this }).forEach(fn);
};
5..times(function (_, n) {
console.log(n);
});
@st98
st98 / Number#….js
Last active August 29, 2015 14:01
2..pow(4) === 16 とか 2.4.round() === 2 とかそういうの。
'abs acos asin atan atan2 ceil cos exp floor log pow round sin sqrt tan'.split(' ').forEach(function (name) {
var slice = [].slice;
Number.prototype[name] = function () {
return Math[name].apply(null, [this].concat(slice.call(arguments)));
};
});