Skip to content

Instantly share code, notes, and snippets.

maugre /
Last active December 11, 2017 16:11
Rebuild a Go project when a code change is detected.
#!/usr/bin/env bash
function goRun() {
echo "-- Building..."
## Build new binary
go build -i -o $BUILDNAME ./cmd/frontend/*.go
maugre / log.go
Created May 30, 2016 12:26 — forked from Tantas/log.go
Apache access logs for golang.
import (
// + execution time.
const apacheFormatPattern = "%s - - [%s] \"%s %s %s\" %d %d \"%s\" \"%s\" %.4f\n"
maugre / sassc-watcher.xml
Created June 25, 2015 11:05
SassC watcher for PhpStorm
<?xml version="1.0" encoding="UTF-8"?>
<option name="arguments" value="-I ~/Software/compass-mixins-master/lib/ scss/$FileName$ css/$FileNameWithoutExtension$.css" />
<option name="checkSyntaxErrors" value="true" />
<option name="description" value="Compiles .scss files into .css files using SassC" />
<option name="exitCodeBehavior" value="ERROR" />
<option name="fileExtension" value="scss" />
<option name="immediateSync" value="false" />
<option name="name" value="sassc compass" />
## Get the size of the image file using Lua.
## Cf.
location ~* \.(?:gif|jpe?g|png)$ {
set_by_lua $img_file_size '
function fsize (file)
local current = file:seek() -- get current position
local size = file:seek("end") -- get file size
file:seek("set", current) -- restore position
return size
maugre / 0_reuse_code.js
Created April 26, 2014 17:19
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console