Skip to content

Instantly share code, notes, and snippets.

//
// Author: Jeff Pelton
//
//
// PROMPT: https://podcastindex.social/@dave/105022919584538996
//
// Anybody want a code challenge?
// I'd like a script,function,method where I can pass it an array of unix timestamps and have it hand back an array of days of the week marking as true the days this podcast publishes episodes on.
// Like:
@comster
comster / DownloadTwitterAvatar.md
Last active October 1, 2019 23:45
Shortcut to download twitter profile images

Download Twitter Avatar Bookmarklet

Instructions

To install this bookmarklet

Make a new bookmark in your browser (right-click on the bookmarks bar and click Add Page...)

  • For the "Name" you might put "Download twitter avatar".
  • Copy the code block below, paste this into the "Location" of a new bookmark.
@comster
comster / index.js
Created June 27, 2017 21:27
requirebin sketch
var SAT = require('sat');
var testCircleCollision = function (a, b) {
var circleA = new SAT.Circle(new SAT.Vector(a.x, a.y), a.r);
var circleB = new SAT.Circle(new SAT.Vector(b.x, b.y), b.r);
var response = new SAT.Response();
var collided = SAT.testCircleCircle(circleA, circleB, response);
console.log("did collide?", collided, "details:", response)
return {
@comster
comster / .block
Last active June 27, 2016 03:15 — forked from mbostock/.block
Zoomable Area
license: gpl-3.0
@comster
comster / proxy.js
Created November 9, 2015 05:38 — forked from richardkazuomiller/proxy.js
node-http-proxy routing proxy with websockets
var httpProxy = require('http-proxy')
var proxy = httpProxy.createProxy({
ws : true
});
var options = {
'herp.dev': 'http://0.0.0.0:9008',
'derp.dev' : 'http://0.0.0.0:3000'
}
<script src="/desktop/require.js"></script>
<script>
require(['index.js'], function(index){
index.init();
});
</script>
var Model = Backbone.Model.extend({
initialize: function() {},
getView: function(options) {
if (!this.hasOwnProperty("view")) {
options.model = this;
this.view = new ModelView(options);
}
return this.view;
}
});
//
// # Simple Mongo Collection API Endpoint
//
var ObjectID = mongo.ObjectID;
(exports = module.exports = function(house, options){
// This endpoint requires a data source
var ds = options.ds;
var col = options.collection;