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
source 'http://rubygems.org' | |
gem 'grape' |
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
<!-- make sure to include this after jquery --> | |
<script type="text/javascript"> | |
jQuery(function ($) { | |
/** | |
* Populates a DOM element with Annotator data | |
* | |
* Params: | |
* | |
* annotations - The data fetched from the Annotator api endpoint. |
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
<?php | |
function uniqueId(){ | |
static $id; | |
if (!isset($id)) { | |
$id=0; | |
} else { | |
$id++; | |
} | |
echo 'id_' . $id . "\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
require 'rubygems' | |
require 'nokogiri' | |
module Helpers | |
def blog_excerpt(item, read_more='<!--READMORE-->') | |
post_dom = Nokogiri::HTML::DocumentFragment.parse(item.compiled_content) | |
more_tag_found = false | |
post_dom.css('*').each do |p, index| | |
if p.inner_html.match(read_more) | |
p.inner_html = p.inner_html.gsub(Regexp.new("#{read_more}.*"), " <a href=\"#{item.identifier}\" title=\"#{item[:title]}\" class=\"read-more\">Read more...</a>") |
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
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" | |
"http://www.w3.org/TR/html4/loose.dtd"> | |
<html> | |
<head> | |
<title>Spying on objects created through Cortex and light-traits.js </title> | |
<!-- light-traits.js and cortex.js, twaked so that I don't need to use requireJS or similar libraries --> | |
<script type="text/javascript" src="https://gist.github.com/raw/946407/4bc11f02474bd466d768589fd0ffaf92195f19ff/light-traits.js"></script> | |
<script type="text/javascript" src="https://gist.github.com/raw/946411/a106ac47587356f6e235136f80692958b324bf8a/cortex.js"></script> | |
<script type="text/javascript" src="http://sinonjs.org/releases/sinon-1.0.0.js"></script> |
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
/* vim:set ts=2 sw=2 sts=2 | |
* ***** BEGIN LICENSE BLOCK ***** | |
* Version: MPL 1.1/GPL 2.0/LGPL 2.1 | |
* | |
* The contents of this file are subject to the Mozilla Public License Version | |
* 1.1 (the "License"); you may not use this file except in compliance with | |
* the License. You may obtain a copy of the License at | |
* http://www.mozilla.org/MPL/ | |
* | |
* Software distributed under the License is distributed on an "AS IS" basis, |
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
/* vim:ts=2:sts=2:sw=2: | |
* ***** BEGIN LICENSE BLOCK ***** | |
* Version: MPL 1.1/GPL 2.0/LGPL 2.1 | |
* | |
* The contents of this file are subject to the Mozilla Public License Version | |
* 1.1 (the "License"); you may not use this file except in compliance with | |
* the License. You may obtain a copy of the License at | |
* http://www.mozilla.org/MPL/ | |
* | |
* Software distributed under the License is distributed on an "AS IS" basis, |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<script type="text/javascript" src="http://github.com/simplegeo/polymaps/raw/v2.2.0/polymaps.min.js"></script> | |
<script type="text/javascript" src="http://github.com/mbostock/polymaps/raw/586fbb0346548a5559b6edea8aab76ac51334da5/lib/crimespotting/crimespotting.js"></script> | |
<style type="text/css"> | |
@import url("http://github.com/simplegeo/polymaps/raw/v2.2.0/examples/example.css"); | |
html, body { |
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 php | |
<?php | |
/*** | |
* PageSnap | |
* | |
* Script for archiving a HTML page (and associated media assets) into a single file. | |
* | |
* Requires: | |
* |