This file contains 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
func captureStdout(f func()) string { | |
tempFile, _ := ioutil.TempFile("", "stdout") | |
oldStdout := os.Stdout | |
os.Stdout = tempFile | |
f() | |
os.Stdout = oldStdout | |
tempFile.Close() | |
b, _ := ioutil.ReadFile(tempFile.Name()) | |
return string(b) | |
} |
This file contains 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
#golang | |
RUN apt-get update | |
RUN apt-get install -y --force-yes curl && \ | |
curl -O https://go.googlecode.com/files/go1.2.linux-amd64.tar.gz && \ | |
tar -C /usr/local -xzf go1.2.linux-amd64.tar.gz && \ | |
rm go1.2.linux-amd64.tar.gz | |
ENV GOPATH /gopath | |
ENV PATH $PATH:$GOPATH/bin:/usr/local/go/bin |
This file contains 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
<!doctype html> | |
<html> | |
<head> | |
<script src="http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> | |
<style> | |
</style> | |
<script> | |
var Mentionable = function(element, callback) { | |
self = this; |
This file contains 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
/server add <name> <team>.irc.slack.com/6667 -ssl -password=<password> | |
/set irc.server.<name>.ssl_verify off | |
/set irc.server.<name>.nicks <username> | |
/connect <name> |
This file contains 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
function! s:ConvertToCharClass(cur) | |
if a:cur =~ '[2-9]' | |
return '[0-' . (a:cur-1) . ']' | |
endif | |
return '0' | |
endfunction | |
function! s:MatchNumberBefore(num) | |
let branches = [] | |
let init = '' |
This file contains 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
function! s:ConvertToCharClass(cur) | |
if a:cur =~ '[2-9]' | |
return '[0-' . (a:cur-1) . ']' | |
endif | |
return '0' | |
endfunction | |
function! s:MatchNumberBefore(num) | |
let branches = [] | |
let init = '' |
This file contains 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
function! HighlightDate(date) | |
exec "syntax match TodoDateBeforeToday '" . a:date . "'" | |
highlight link TodoDateBeforeToday TodoRed | |
endfunction | |
function! UpdateDateHighlights() | |
let l:match = '\[\(\d\{2}\)\-\(\d\{2}\)\-\(\d\{4}\)\]' | |
let l:yearToday = str2nr(strftime("%Y")) | |
let l:line = 0 | |
while l:line < line('$') |
This file contains 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
a107598d | |
elasticsearch.4.service not-found failed failed elasticsearch.4.service | |
1e99f455 | |
elasticsearch.4.service loaded active running elasticsearch | |
fe2579bc | |
elasticsearch.1.service loaded active running elasticsearch | |
3e605aff |
This file contains 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
a107598d | |
elasticsearch.4.service loaded active running elasticsearch | |
1e99f455 | |
elasticsearch.4.service loaded failed failed elasticsearch | |
fe2579bc | |
elasticsearch.1.service loaded active running elasticsearch | |
3e605aff |
This file contains 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
[Unit] | |
Description=docker-registry | |
After=docker.service | |
Requires=docker.service | |
[Service] | |
TimeoutSec=5min | |
ExecStart=/usr/bin/docker run --name docker-registry --rm -p 5000:5000 -v /media/state/registry:/tmp/registry samalba/docker-registry | |
ExecStop=-/usr/bin/docker stop docker-registry | |
ExecStopPost=-/usr/bin/docker rm docker-registry |