Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
I may be slow to respond.

Kuniwak Kuniwak

💭
I may be slow to respond.
View GitHub Profile
@nulltask
nulltask / 20140826.md
Last active Jul 6, 2020
Express / Socket.IO をスケールアウトしてみよう
View 20140826.md
@taiki45
taiki45 / fizzubzz.hs
Created Dec 17, 2013
http://bugrammer.hateblo.jp/entry/2013/12/15/220418 を読んで、こう書けばモーナド♡って気持ち、表現できたのではとおもってみたりでし
View fizzubzz.hs
fizz x = if x `mod` 3 == 0 then Left "fizz" else Right x
buzz x = if x `mod` 5 == 0 then Left "buzz" else Right x
fizzbuzz x = if x `mod` 15 == 0 then Left "fizzbuzz" else Right x
number x = Left $ show x
doFizzBuzz x = either id id $ fizzbuzz x >>= buzz >>= fizz >>= number
main = foldr1 (>>) $ fmap putStrLn (fmap doFizzBuzz [1..])
View 絶望しかない.java
Set<String> keys = map.keySet();
for (String key : keys) {
//some condes
}
//↑が↓になった
Set<String> keys = map.keySet();
String[] keyarray = keys.toString().split(",");
for(int i=0; i<keyarray.length; i++){
@rch850
rch850 / irc.sh
Created Sep 27, 2013
シェルスクリプトからIRCで発言
View irc.sh
#!/bin/sh
nc -w 10 $IRC_SERVER 6667 << EOF &>/dev/null
PASS $IRC_PASS
NICK $IRC_NICK
USER $IRC_NICK 8 * : $IRC_NICK
JOIN $IRC_CH
PRIVMSG $IRC_CH : $1
QUIT
EOF
@okapies
okapies / promises-are-functional.md
Last active Mar 14, 2020
翻訳: ”命令型のコールバック、関数型のプロミス: Node が逸した最大の機会” by James Coglan
View promises-are-functional.md

命令型のコールバック、関数型のプロミス: Node が逸した最大の機会

Original: "Callbacks are imperative, promises are functional: Node's biggest missed opportunity" by James Coglan

Translated by Yuta Okamoto (@okapies)

Note

  • 訳者は JavaScript や Node.js に関する専門知識がほとんどありません。識者のツッコミをお待ちしております。「◯◯が分からない」等も歓迎です。
  • 元記事から構成を一部変更しています。また、関数型プログラミングに関する記述のうち、議論の骨子に絡まないものは省略しています。
@cobyism
cobyism / gh-pages-deploy.md
Last active Aug 8, 2020
Deploy to `gh-pages` from a `dist` folder on the master branch. Useful for use with [yeoman](http://yeoman.io).
View gh-pages-deploy.md

Deploying a subfolder to GitHub Pages

Sometimes you want to have a subdirectory on the master branch be the root directory of a repository’s gh-pages branch. This is useful for things like sites developed with Yeoman, or if you have a Jekyll site contained in the master branch alongside the rest of your code.

For the sake of this example, let’s pretend the subfolder containing your site is named dist.

Step 1

Remove the dist directory from the project’s .gitignore file (it’s ignored by default by Yeoman).

View entypo.css
@font-face {
font-family: 'EntypoRegular';
src: url('font/entypo.eot');
src: url('font/entypo.eot?#iefix') format('embedded-opentype'),
url('font/entypo.woff') format('woff'),
url('font/entypo.ttf') format('truetype'),
url('font/entypo.svg#EntypoRegular') format('svg');
font-weight: normal;
font-style: normal;
}
View codegolf_circle_75.js
for(s='',x=y=n=40;y+n;s+='-*\n'[x+n?x*x--+y*y<900|0:(x=n,y-=2,2)]);return s
@mitukiii
mitukiii / percol_zsh.md
Created Dec 7, 2012
percol 入れて zsh と組み合わせたら超便利
View percol_zsh.md

percol 入れて zsh と組み合わせたら超便利

だったので紹介

percol とは

percol は入力の1行を1候補として,部分一致かつ AND 検索で絞り込みし,選択した候補を出力するコマンドです.端的に言えば Emacs の anything.el のコマンド版です.
@jboner
jboner / latency.txt
Last active Aug 8, 2020
Latency Numbers Every Programmer Should Know
View latency.txt
Latency Comparison Numbers (~2012)
----------------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD
You can’t perform that action at this time.