This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function rarr (n) { | |
var arr = []; | |
for (var i = n; i >= 0; i--) { | |
arr.push(i); | |
} | |
arr.sort(); | |
return arr; | |
} | |
var total = 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function fastfib(n){ | |
var i=0, fibs = [0,1]; | |
for (; i < n; i += 1) { | |
fibs.push(fibs[0] + fibs[1]); | |
fibs.shift(); | |
} | |
return fibs[0]; | |
} | |
var n = 0, last = 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [[ -z "$1" ]]; then | |
echo " => Usage: $0 user:branch" | |
exit 64 | |
fi | |
user=$(cut -d ":" -f1 <(echo "$1")) | |
repo="homebrew-cask" | |
branch=$(cut -d ":" -f2 <(echo "$1")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'formula' | |
class Hotot < Formula | |
homepage 'https://github.com/lyricat/Hotot' | |
url 'https://github.com/lyricat/Hotot/archive/0.9.8.10.tar.gz' | |
sha1 '09e1aae05546b99abc593df0c55d664a04336c43' | |
head 'https://github.com/lyricat/Hotot.git' | |
depends_on 'cmake' => :build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Golfed. 813 chars. | |
# Original: https://github.com/Qwertylex/bash-kanatrainer | |
# License: CC BY-SA 3.0. | |
l="a;i;u;e;o;ka;ki;ku;ke;ko;sa;shi;su;se;so;ta;chi;tsu;te;to;na;ni;nu;ne;no;ha;hi;fu;he;ho;ma;mi;mu;me;mo;ya;yu;yo;ra;ri;ru;re;ro;wa;wo;n" | |
hira="あいうえおかきくけこさしすせそたちつてとなにぬねのはひふへほまみむめもやゆよらりるれろわをん" | |
kata="アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマモムメモヤユヨラリルレロワヲン" | |
read -ep "hira or kata: " c;a=$(eval echo $`echo ${c}`) | |
n=0;r=0;t=${#a};IFS=';' read -ra l <<< "$l" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
N = 100 | |
digits = "" | |
sums = [] | |
for n in [1..N] | |
digits += Math.floor Math.random() * 10 | |
for n in [0..(N-6)] | |
sub = digits.substr n, 5 | |
sum = 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var N = 1000, | |
digits = "", | |
sums = [], | |
i,l,n,sum,sub; | |
for (n = 1; n <= N; ++n) { | |
digits += Math.floor(Math.random() * 10); | |
} | |
for (n = 0; n <= (N-6); ++n) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
seq = (a, b = a) -> | |
if typeof a == "number" and (a == b or typeof b == "number") | |
if a != b | |
"(#{a}..#{b})" | |
else | |
"(0..#{a})" | |
else if typeof a != "string" or !rgx.test a or a == "" | |
"(0..1)" | |
else | |
[ok, start, end] = a.match rgx |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[22:56:38] <Milos> what'as new | |
[22:56:40] <Milos> how was camp | |
[22:56:42] <Milos> whatcha coding | |
[22:56:47] <Milos> how's uni | |
[22:56:49] <Milos> whatcha studying | |
[22:56:53] <passcod> camp was sunny | |
[22:56:56] <unixbrain> !quotes * /.*/ | |
[22:56:58] <woot> 2012-02-26 18:17:28 | <akiwiguy> my ups kicked in this morning | |
[22:57:14] <unixbrain> !quotes * /.*/ | |
[22:57:16] <woot> 2012-01-06 16:01:47 | <spectre0> !calc (-9.551 + 0.819152a = 0.087156b + 28.98) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Ping => (-c 10, avg ms, lower is better) | |
From home: tokyo:379, london:449, newark:349, atlanta:206, dallas:179, fremont:174 | |
From sydn: tokyo:116, london:392, newark:247, atlanta:219, dallas:242, fremont:190 | |
---- | |
Data => (20s, avg KB/s, higher is better) | |
From home: tokyo:170, london:457, newark:350, atlanta:461, dallas:560, fremont:616 | |
From sydn: tokyo:2196, london:628, newark:2308, atlanta:766, dallas:1097, fremont:1413 |