Skip to content

Instantly share code, notes, and snippets.

@bencevans
bencevans / gist:5162086
Created March 14, 2013 15:06
spotify-web skeleton

var Spotify = require('spotify-web');

{ [Function: Spotify]
  gid2id: [Function],
  id2uri: [Function],
  uri2id: [Function],
  gid2uri: [Function],
  uriType: [Function],
  login: [Function],

super_: [Function: EventEmitter] }

@bencevans
bencevans / README.md
Created February 24, 2013 16:34
Unofficial We Are Hunted API (Used by their Spotify app)

Unofficial We Hunted API

I believe there used to be an official API however all the docs seems to of vanished so...

This API is used by the We Are Hunted Spotify App thus pretty stable. Reverse Engineered by @bencevans. Usage isn't to bring any harm to We Are Hunted, just for educational purposes obviously!

Formats

JSON

@bencevans
bencevans / index.html
Created February 12, 2013 19:05
Leaflet.js + Open Sreet Maps Bootstrap
<html>
<head>
<title></title>
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.5/leaflet.css" />
<!--[if lte IE 8]>
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.5/leaflet.ie.css" />
<![endif]-->
<style>
#map { height: 180px; }
</style>
@bencevans
bencevans / README.md
Last active December 12, 2015 04:39
Barton Internet Guard

Barton Internet Guard (Obsolete)

The proxy has been updated to use a new login design however this tool has not been updated.

Barton Peveril's WiFi requires authentication... every 15 mins.

When working on projects that require an internet connection this can easily break them. This gist/script automates the login process and can be run from terminal/cron job.

Requirements

/**
* L.TileLayer is used for standard xyz-numbered tile layers.
*/
L.Google = L.Class.extend({
includes: L.Mixin.Events,
options: {
minZoom: 0,
maxZoom: 18,
@bencevans
bencevans / jstable.js
Last active December 10, 2015 02:48
JS Table DOM Helper
var jstable = function(DOMTable, data, options) {
return new JSTable(DOMTable, data, options);
};
var JSTable = function() {
this.element = DOMTable;
this.data = data || [];
this.options = options || {};
if(typeof this.options.noDataMessage == 'undefined')
@bencevans
bencevans / gist:4121772
Created November 20, 2012 22:42
Release Header
/*
* {{name}} v{{version}}
* {{website}}
*
* Copyright 2012 {{author.name}} <{{author.email}}> ({{author.website}})
* Released under the {{licence.name}} license
* {{licence.url}}
*
* Date: {{date}}
*/
@bencevans
bencevans / gist:4117847
Created November 20, 2012 13:05
Bubble Sort
function bubbleSort (sortingArray) {
var goto = sortingArray.length - 1;
for(var key in sortingArray) {
for(var i = 0; i <= goto - 1; i++) {
if(sortingArray[i] > sortingArray[i + 1]) {
// Swap
var temp = sortingArray[i];
sortingArray[i] = sortingArray[i +1];
sortingArray[i + 1] = temp;
}
@bencevans
bencevans / dabblet.css
Created November 10, 2012 15:26
SoundForcast
/**
* SoundForcast
*/
* { -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; }
body {
background: linear-gradient(180deg, #111, #000);
@bencevans
bencevans / gist:4036327
Created November 8, 2012 02:56
Mongoose Bootstrap.coffee
mongoose = require 'mongoose'
db = mongoose.createConnection(config.mongo.host, config.mongo.db);
db.on 'error', console.error.bind(console, 'connection error:')
db.once 'open', () ->
console.log 'Connected to DB'
schemaFiles = fs.readdirSync './db/schemas'
for filename in schemaFiles