Skip to content

Instantly share code, notes, and snippets.

async function* generate(count) {
for (let i = 1; i <= count; i++) {
await new Promise((resolve) => setTimeout(resolve, 1000));
yield i;
}
}
async function* chunkAsync(iterator, size) {
let items = [];
for await (const item of iterator) {
@murooka
murooka / ubuntu.md
Last active October 19, 2017 18:16

ubuntuのバージョン確認

cat /etc/issue

インストール

sudo apt-get install zsh nginx-full

wget https://github.com/buger/goreplay/releases/download/v0.16.1/gor_0.16.1_x64.tar.gz
require 'parslet'
class Parser < Parslet::Parser
rule(:comment) { str(';') >> match(/./).repeat(0) >> str("\n") }
rule(:whitespace) { str(' ') | str("\n") }
rule(:atmosphere) { whitespace | comment }
rule(:intertoken_space) { atmosphere.repeat(0) }
(function () {
var initBoard = function (w, h) {
var board = [];
for (var y=0; y<h; y++) {
var line = [];
for (var x=0; x<w; x++) {
line.push(0);
}
board.push(line);
@murooka
murooka / perl_first.md
Last active March 10, 2020 23:37
Linuxでのperl環境の構築

perlの環境構築

perlbrewとperlのインストール

何はともあれまずperlbrewを入れる

\curl -L http://install.perlbrew.pl | bash
echo 'source ~/perl5/perlbrew/etc/bashrc' >> .bashrc
source .bashrc
@murooka
murooka / vim.md
Last active December 26, 2015 16:29
vimについてだらだら話す

vimについてだらだら話す

画面操作

  • <C-w>v

    • 画面を縦分割
  • <C-w>s

    • 画面を横分割
  • <C-w>h (or j,k,l)