Skip to content

Instantly share code, notes, and snippets.

@walling
walling / async.coffee
Created July 19, 2011 00:23 — forked from tcr/async.coffee
Lean and Mean Serial function in CoffeeScript
# Lean and Mean Serial DSL for CoffeeScript
# (based of https://gist.github.com/1090670 by timcameronryan)
serial = (spec) ->
commands = (func for key, func of spec when key != 'catch')
next = (err, args...) ->
return spec.catch(err) if err
commands.shift().apply(next, args) if commands.length > 0
next null
return
@sile
sile / 0_raft.md
Last active May 27, 2024 07:53
Raft(分散合意アルゴリズム)について
@knsh14
knsh14 / content.md
Created August 18, 2016 01:42
golang/go CodeReviewComments 日本語翻訳

Go Code Review Comments

原文

go fmt

あなたのコードに gofmt を走らせると、自動的に機械的に直すことのできるスタイルの大部分を修正してくれます。 世にあるGolang コードのほとんどすべてが gofmt を使っています。 この文章の残りは機械的に直すことのできないポイントについて解説します。

代わりに goimports を使う手段もあります。

@kazuho
kazuho / git-blame-pr.pl
Last active June 28, 2022 07:15
git-blame by PR #
#! /usr/bin/perl
#
# Written in 2017 by Kazuho Oku
#
# To the extent possible under law, the author(s) have dedicated all copyright and related and neighboring rights to this software to the public domain worldwide. This software is distributed without any warranty.
# You should have received a copy of the CC0 Public Domain Dedication along with this software. If not, see <http://creativecommons.org/publicdomain/zero/1.0/>.
#
use strict;
use warnings;
@posener
posener / go-table-driven-tests-parallel.md
Last active July 10, 2024 13:19
Be Careful with Table Driven Tests and t.Parallel()

Be Careful with Table Driven Tests and t.Parallel()

We Gophers, love table-driven-tests, it makes our unittesting structured, and makes it easy to add different test cases with ease.

Let’s create our table driven test, for convenience, I chose to use t.Log as the test function. Notice that we don't have any assertion in this test, it is not needed to for the demonstration.

func TestTLog(t *testing.T) {
	t.Parallel()
@greymd
greymd / yamaya_fib.md
Last active February 20, 2023 08:12
yamayaさんの難読化シェル芸(フィボナッチ数列) 解説

yamayaさんの難読化シェル芸(フィボナッチ数列) 解説

経緯

(1) ある日、yamaya さんという怖い方がこのツイートを投稿する。

yamaya_src

@kevin-smets
kevin-smets / local-pi-hole-in-docker-macos.md
Last active July 9, 2024 19:49
Local Pi-hole in Docker [MacOS]

Prerequisites

  • Docker
  • Docker Compose

If you don't have these, run

brew install docker docker-compose