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
function randStr() { | |
return Math.random().toString(36).substring(7); | |
} |
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
Handlebars.registerHelper('limit', function(collection, limit, start) { | |
var out = [], | |
i, c; | |
start = start || 0; | |
for (i = c = 0; i < collection.length; i++) { | |
if (i >= start && c < limit+1) { | |
out.push(collection[i]); | |
c++; |
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"?> | |
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"> | |
<channel> | |
<title>{{ sitename }}</title> | |
<description>{{ description }}</description> | |
<link>{{ baseUrl }}</link> | |
<atom:link href="{{ baseUrl }}/feed.xml" rel="self" type="application/rss+xml" /> | |
{{#each collections.entries}} |
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
func createTestContext(t *testing.T) (context.Context, context.CancelFunc) { | |
if deadline, ok := t.Deadline(); ok { | |
return context.WithDeadline(context.Background(), deadline) | |
} | |
return context.WithTimeout(context.Background(), 10*time.Second) | |
} |