Skip to content

Instantly share code, notes, and snippets.

View robhawkes's full-sized avatar

Robin Hawkes robhawkes

View GitHub Profile
@robhawkes
robhawkes / twitter.js
Created August 12, 2011 10:58
Twitter scraper in Node
// Reorder, rename, and document variables at some point
var sys = require("sys"),
twitter = require("ntwitter"),
mongoose = require("mongoose"),
db_user,
db_pass,
db_url,
db_port,
db_name,
coll,
@robhawkes
robhawkes / gist:1966511
Created March 3, 2012 14:51
Gamepad API (Firefox)
var controller;
// Run When a gamepad is connected
function onGamepadConnected(e) {
controller = e.gamepad;
console.log("Gamepad connected", controller.id);
}
// Run on button change
function onGamepadButtonDown(e) {
@robhawkes
robhawkes / gist:2558821
Created April 30, 2012 14:32
BrowserQuest image license
Images from <a href="https://github.com/mozilla/BrowserQuest">BrowserQuest</a> used under <a href="http://creativecommons.org/licenses/by-sa/3.0/">CC-BY-SA 3.0</a>.
@robhawkes
robhawkes / Package Controls.sublime-settings
Last active August 29, 2015 13:56
Sublime Text preferences
{
"installed_packages":
[
"Alignment",
"Base16 Color Schemes",
"ColorPicker",
"GitGutter",
"Gutter Color",
"HTML-CSS-JS Prettify",
"InactivePanes",
{
"properties": {
"name": "Performance",
"project": "vizicities",
"id": "vizicities/Performance",
"environment": {
"type": "noflo-browser"
},
"changed": true
},
/* globals window, _, VIZI, d3, THREE */
(function() {
"use strict";
/**
* Blueprint OBJ output
* @author Robin Hawkes - vizicities.com
*/
// output: {
var csvConfig = {
input: {
type: "BlueprintInputCSV",
options: {
path: "./data/some.csv"
}
},
output: {
type: "BlueprintOutputDebugPoints",
options: {}
@robhawkes
robhawkes / img_url.js
Created July 3, 2020 16:38
Responsive Cloudinary images in Ghost
// Usage:
// `{{img_url feature_image}}`
// `{{img_url profile_image absolute="true"}}`
// Note:
// `{{img_url}}` - does not work, argument is required
//
// Returns the URL for the current object scope i.e. If inside a post scope will return image permalink
// `absolute` flag outputs absolute URL, else URL is relative.
const url = require('url');
//MIT License
//Copyright (c) 2021 Felix Westin
//Source: https://github.com/Fewes/MinimalAtmosphere
//Ported to GLSL by Marcin Ignac
#ifndef ATMOSPHERE_INCLUDED
#define ATMOSPHERE_INCLUDED
// -------------------------------------