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
# | |
# upstart script for gogs (Go Git Service) | |
# | |
author "tsv" | |
description "gogs upstart script" | |
start on (local-filesystems and net-device-up) | |
stop on shutdown |
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
Template.langs.helpers({ | |
list: function() { | |
return [ | |
{"name": "C#"}, | |
{"name": "JavaScript"}, | |
{"name": "CoffeeScript"} | |
]; | |
} | |
}); |
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
<template name="langs"> | |
<div> | |
<h2>Array of objects without value property.</h2> | |
<div class="form-group"> | |
<input class="form-control typeahead" name="lang" type="text" placeholder="Programming language" | |
autocomplete="off" spellcheck="off" data-source="list" data-value-key="name"/> | |
</div> | |
</div> | |
</template> |
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
<template name="example"> | |
<div class="gist"> | |
{{{gist "sergeyt" "173f8a5dff83a3b5858a"}}} | |
</div> | |
</template> |
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
// WARNING this gist is an example with potentially non-compilable code! | |
using System; | |
using System.Collections.Generic; | |
using System.Threading.Tasks; | |
namespace Owin.Routing | |
{ | |
using AppFunc = Func<IDictionary<string, object>, Task>; |
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
go get -u golang.org/x/tools/... | |
go get -u github.com/golang/lint/golint/... | |
go get -u github.com/rogpeppe/godef/... | |
go get -u github.com/Unknwon/bra/... | |
go get -u github.com/constabulary/gb/... | |
go get -u github.com/nats-io/gnatsd/... | |
go get -u github.com/nsqio/nsq/... | |
go get -u github.com/blevesearch/bleve/... | |
go get -u github.com/onsi/ginkgo/ginkgo/... | |
go get -u github.com/kisielk/godepgraph/... |
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
cwd=$PWD | |
for d in */ ; do | |
dirname="$cwd/$(basename "${d}")" | |
cd $dirname | |
if [ -d ".git" ]; then | |
git pull | |
fi | |
if [ -d ".hg" ]; then | |
hg pull -u | |
fi |
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
interface Group<TKey, TValue> { | |
key: TKey; | |
values: TValue[]; | |
} | |
function groupBy<TKey, TValue>(array: TValue[], keyFn: (t: TValue) => TKey): Group<TKey,TValue>[] { | |
const result: Group<TKey, TValue>[] = []; | |
const map = new Map<TKey, Group<TKey, TValue>>(); | |
array.forEach(t => { | |
const k = keyFn(t); |
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
watch() { while inotifywait --exclude .swp -e modify -r .; do $@; done; } |
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 Immutable from 'immutable'; | |
import {reduce} from 'lodash'; | |
type ErrorMap = Immutable.Map; | |
type Validator = (value, path, form) => ErrorMap; | |
function validationRules(rules) { | |
return (value, path, form) => { | |
return reduce(rules, (result, fn, key) => { | |
if (path.contains(key)) { |