This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
P=`pwd` | |
BUILDNAME=/tmp/${P##*/}-build | |
function goRun() { | |
echo "-- Building..." | |
## Build new binary | |
go build -i -o $BUILDNAME ./cmd/frontend/*.go |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ( | |
"fmt" | |
"io" | |
"net/http" | |
"strings" | |
"time" | |
) | |
// https://httpd.apache.org/docs/2.2/logs.html#combined + execution time. | |
const apacheFormatPattern = "%s - - [%s] \"%s %s %s\" %d %d \"%s\" \"%s\" %.4f\n" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<TaskOptions> | |
<TaskOptions> | |
<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" /> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Get the size of the image file using Lua. | |
## Cf. http://wiki.nginx.org/HttpLuaModule#set_by_lua. | |
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 | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |