List all posts, tags and categories in Jekyll.
Octopress users: if you found "
is escaped in the generated JSON file, please change them to \"
. Refer to this issue.
// Since `overlapArea` function is monotonic increasing, we can perform a | |
// simple bisection search to find the distance that leads to an overlap | |
// area within epsilon of the desired overlap. | |
function distanceForOverlapArea(r1, r2, desiredOverlap) { | |
// Ensure r1 <= r2 | |
if (r1 > r2) { | |
var temp = r2; | |
r2 = r1; | |
r1 = temp; | |
} |
// Assuming a 'document' strucutre like below to represent a single icon | |
{ | |
"id": "some-unique-id", | |
"tags": ["tag1", "tag2", "tag3"], | |
"title": "My Awesome Icon" | |
} | |
// You can then set up an index with the following, I put a boost on the tags, but it depends on your data |
function mapValues(obj, fn) { | |
return Object.keys(obj).reduce((result, key) => { | |
result[key] = fn(obj[key], key); | |
return result; | |
}, {}); | |
} | |
function pick(obj, fn) { | |
return Object.keys(obj).reduce((result, key) => { | |
if (fn(obj[key])) { |
List all posts, tags and categories in Jekyll.
Octopress users: if you found "
is escaped in the generated JSON file, please change them to \"
. Refer to this issue.
Ideas are cheap. Make a prototype, sketch a CLI session, draw a wireframe. Discuss around concrete examples, not hand-waving abstractions. Don't say you did something, provide a URL that proves it.
Nothing is real until it's being used by a real user. This doesn't mean you make a prototype in the morning and blog about it in the evening. It means you find one person you believe your product will help and try to get them to use it.
* { | |
margin: 0; | |
} | |
html, body { | |
height: 100%; | |
} | |
/* main content wrapper */ | |
.wrapper { | |
min-height: 100%; | |
height: auto !important; |
function cssLoaded(href) { | |
var cssFound = false; | |
for (var i = 0; i < document.styleSheets.length; i++) { | |
sheet = document.styleSheets[i]; | |
if (sheet['href'].indexOf(href) >= 0 && sheet['cssRules'].length > 0) { | |
cssFound = true; | |
} | |
}; |
/** | |
* Load disqus comments when visitor scroll down page to comments | |
* | |
* Usage: | |
* Add a div with id "disqus_thread" and data attributes for every disqus parameter: | |
* | |
* <div id="disqus_thread" data-disqus-shortname="username" data-disqus-url="http://example.com/post/post-name/"></div> | |
* | |
* @author: Murat Corlu | |
* @link: https://gist.github.com/gists/2290198 |
Copyright (c) 2011 ZURB, http://www.zurb.com/ |
// Includes functions for exporting active sheet or all sheets as JSON object (also Python object syntax compatible). | |
// Tweak the makePrettyJSON_ function to customize what kind of JSON to export. | |
var FORMAT_ONELINE = 'One-line'; | |
var FORMAT_MULTILINE = 'Multi-line'; | |
var FORMAT_PRETTY = 'Pretty'; | |
var LANGUAGE_JS = 'JavaScript'; | |
var LANGUAGE_PYTHON = 'Python'; |