Skip to content

Instantly share code, notes, and snippets.

Garrett Wilkin garrettwilkin

Block or report user

Report or block garrettwilkin

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:42a31d5e7d38dc30442f
"metadata": {
"name": "",
"signature": "sha256:bfb449ef2b39f66d75879e049a1f0d9796b61e32908ed1c1f3bd00ec7dcf56ee"
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
"cells": [
garrettwilkin / gist:8228461
Created Jan 2, 2014
Trying to access the result object to write my response to the client.
View gist:8228461
I have a server that uses this director setup:
function posts() {
var type = 'posts';
function sections() {
var type = 'sections';
garrettwilkin / example
Created Dec 20, 2013
Exceptions via assert.equal
View example
$ node
> var assert = require('assert');
> var i = 10;
> var j = 11;
> assert.equal(i,j)
AssertionError: 10 == 11
at repl:1:9
View GO AWAY git file!
» ~/Code/Parsely/web (web+apidocs) [master]
$ git checkout -- p2/index.php
» ~/Code/Parsely/web (web+apidocs) [master]
$ git status
# On branch master
# Your branch is ahead of 'origin/master' by 1 commit.
# (use "git push" to publish your local commits)
# Changes not staged for commit:
# (use "git add <file>..." to update what will be committed)
View gist:7320253
data: [
tags: null,
url: "",
title: "FACT Writers pick their top 10 albums of all time",
section: "Features",
author: "joseph",
thumb_url_medium: "",
image_url: "",
View gist:7319839
<meta name="parsely-page" content="{&quot;title&quot;: &quot;Morrissey hospitalised with concussion after apparent car accident&quot;, &quot;link&quot;: &quot;;, &quot;section&quot;: &quot;News&quot;, &quot;image_url&quot;: &quot;;,&quot;type&quot;: &quot;post&quot;,&quot;post_id&quot;: &quot;189193&quot;, &quot;author&quot;: &quot;joseph&quot;, &quot;pub_date&quot;: &quot;2013-11-04T08:43:34Z&quot;}">
garrettwilkin /
Created Oct 31, 2013
This file gives me the error: $ python Traceback (most recent call last): File "", line 3, in <module> print datetime.strptime('2013-10-29T02:03:59Z','%Y-%m-%dT%H:%M:%S%z') AttributeError: 'module' object has no attribute 'strptime'
import datetime
print datetime.strptime('2013-10-29T02:03:59Z','%Y-%m-%dT%H:%M:%S%z'
garrettwilkin / Inconsistent API status codes.
Created Oct 22, 2013
The first element is the resp.status_code. The JSON blob is the resp.text. This is a response object from the requests module.
View Inconsistent API status codes.
$ python
200 /v2/analytics/posts {"message": "Forbidden", "code": 403, "success": false}
200 /v2/analytics/authors {"message": "Forbidden", "code": 403, "success": false}
200 /v2/search {"message": "missing api key", "code": 500, "success": false}
200 /v2/realtime/posts {"message": "Forbidden", "code": 403, "success": false}
200 /v2/analytics/author/Jeff%20Poor/detail {"message": "Forbidden", "code": 403, "success": false}
200 /v2/analytics/post/detail {"message": "Forbidden", "code": 403, "success": false}
200 /v2/related {"message": "missing api key", "code": 500, "success": false}
403 /v2/shares/posts {"message": "Forbidden", "code": 403, "success": false}
403 /v2/shares/authors {"message": "Forbidden", "code": 403, "success": false}
View gist:7088146
// Clears the recommendations div.
function clearResults() {
var recDiv = $("#recommendations");
recDiv.innerHtml = "<p>Recommendations results to appear here.</p>";
garrettwilkin / failing at bootstrap
Last active Dec 25, 2015
When I click the "Fly!" button, I see the console.log output. Not so with the "Go!" button. What gives?
View failing at bootstrap
// Callback to populate recommendations div.
callback = function(data) {
$.each(, function(i, datum) {
var thumb = "<div class='thumb'><img src='" + datum.thumb_url_medium + "'></div>",
title = "<div class='title'>" + datum.title + "</div>"
recDiv.append("<div class='post'>"+title+thumb+"</div>");
You can’t perform that action at this time.