Skip to content

Instantly share code, notes, and snippets.

View marco-m's full-sized avatar
🥕

Marco Molteni marco-m

🥕
View GitHub Profile
@esauser
esauser / build.bat
Created May 6, 2019 19:13
Concourse Windows Worker
@echo off
nuget restore -Verbosity normal
if %errorlevel% neq 0 exit /b %errorlevel%
msbuild -p:Configuration=Release ^
-p:WarningLevel=0
if %errorlevel% neq 0 exit /b %errorlevel%
dotnet.exe test TestProject.csproj --configuration Release --no-build -v n
@peterhellberg
peterhellberg / graceful.go
Last active August 20, 2023 08:49
*http.Server in Go 1.8 supports graceful shutdown. This is a small example.
package main
import (
"context"
"log"
"net/http"
"os"
"os/signal"
"time"
)
@efcasado
efcasado / eqc.md
Last active December 16, 2023 00:07
A gentle introduction to (Erlang) QuickCheck

Erlang QuickCheck

What is QuickCheck?

QuickCheck is a language for stating properties of programs.

?FORALL(X, nat(), X*X >= 0)
odessa(~/src/github.com/pkg/mach) % cat sys_darwin_amd64.s
// Copyright 2009 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
//
// System calls and other sys.stuff for AMD64, Darwin
// See http://fxr.watson.org/fxr/source/bsd/kern/syscalls.c?v=xnu-1228
// or /usr/include/sys/syscall.h (on a Mac) for system call numbers.
//
@rjattrill
rjattrill / multiline-values.yaml
Created November 18, 2013 06:33
Break YAML over multiple lines
# Join multiple lines without new line
value: >
part 1
part 2
# Join with newline
value2: |
line 1
line 2
@maxlapshin
maxlapshin / tcp_bench.erl
Created April 5, 2012 10:37
gen_tcp:send vs port_command
-module(bench).
-compile(export_all).
-define(COUNT, 1000).
-define(SIZE, 10000).
-define(PORT, 9001).
read_all(Socket, Limit) when Limit > 0 ->
case gen_tcp:recv(Socket, 100*?SIZE) of
{ok, Bin} ->
@blacktaxi
blacktaxi / ruby-fmt.clj
Created January 25, 2012 14:42
Ruby-like string interpolation in Clojure
; Ruby has an awesome feature -- string interpolation. Read about it on the internet.
; On the other hand, Clojure only has cumbersome Java string formatting, which can not be
; used without pain after you've tried Ruby.
; So here's this simple macro that basically allows you to do most things you could do
; with Ruby string interpolation in Clojure.
(ns eis.stuff
(:require [clojure.string]))
@darrenderidder
darrenderidder / bashpath.sh
Created May 16, 2011 15:24
Get path of running script in bash
#!/bin/bash
# A simple test script to demonstrate how to find the
# "absolute path" at which a script is running. Used
# to avoid some of the pitfals of using 'pwd' or hard-
# coded paths when running scripts from cron or another
# directory.
#
# Try it out:
# run the script from the current directory, then