Skip to content

Instantly share code, notes, and snippets.

@andrewxhill
andrewxhill / index.html
Last active August 29, 2015 14:07
Static torque for heatmap effect
<!DOCTYPE html>
<html>
<head>
<title>Torque runtime example | CartoDB.js</title>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
<link rel="shortcut icon" href="http://cartodb.com/assets/favicon.ico" />
<style>
html, body, #map {
height: 100%;
#!/bin/bash
# Settings: edit these as needed
PROJECT_NAME="test"
OUTPUT_DIRECTORY="~/Documents/MapBox/export/"
# first change into TileMill code directory
cd /Applications/TileMill.app/Contents/Resources/
# hint: use http://bboxfinder.com/ to get bounds in lon/lat
//When I wrote this, only God and I understood what I was doing
//Now, God only knows
var fibonacci = function (_) {
for(_=[+[],++[[]][+[]],+[],_],_[++[++[++[[]][+[]]][+[]]][+[]]]=(((_[++[++[++[[]][+[]]][+[]]][+[]]]-(++[[]][+[]]))&(((--[[]][+[]])>>>(++[[]][+[]]))))===(_[++[++[++[[]][+[]]][+[]]][+[]]]-(++[[]][+[]])))?(_[++[++[[]][+[]]][+[]]]=++[[]][+[]],_[++[++[++[[]][+[]]][+[]]][+[]]]-(++[[]][+[]])):+[]; _[++[++[++[[]][+[]]][+[]]][+[]]]--; _[+[]]=(_[++[[]][+[]]]=_[++[++[[]][+[]]][+[]]]=_[+[]]+_[++[[]][+[]]])-_[+[]]);
return _[++[++[[]][+[]]][+[]]];
}
@aseemk
aseemk / README.md
Last active February 14, 2018 16:41
A bookmarklet for "selecting all" (technically, "toggling all") checkboxes on the Amazon AWS S3 console.
@maurizi
maurizi / mikes-timesheet-improvements.user.js
Last active March 15, 2019 18:23
Mike's Timesheet Improvements
// ==UserScript==
// @name Mike's timesheet improvements
// @namespace http://tampermonkey.net/
// @version 0.2
// @description Add plus time buttons to the new GetMyTime
// @author Michael Maurizi
// @match https://app.getmytime.com/timesheet.aspx
// @grant none
// ==/UserScript==
@GFoley83
GFoley83 / location-finder.js
Last active January 22, 2020 11:55
A function which returns a jQuery promise that resolves when a user's location has been found. Also handles the scenario where by when not clicking allow/deny the browser never fires the timeout option of `getCurrentPosition()`. If `getCurrentPosition()` fails then the fallback lat lng is used instead.
/*
Sample use:
var loc = new LocationFinder(-41.29247, 174.7732);
$.when(loc.findUserLocationAsync()).then(function (lat, lng) {
// console.log("Lat & lng set as: ", loc.usersPosition())
});
*/
@shauns
shauns / slack.py
Created August 10, 2016 14:44
Deleting and listing slack files, sorting by size
from slacker import Slacker
import itertools
slack = Slacker('<API TOKEN>')
pages = slack.files.list(page=1).body['paging']['pages']
all_the_files = list(itertools.chain(*[slack.files.list(page=i).body['files'] for i in range(1,pages + 1)]))
biggest_first = sorted(all_the_files, key=lambda f: f['size'], reverse=True)
@christopher-hopper
christopher-hopper / vm-resize-hard-disk.md
Last active April 5, 2022 10:30
Resize a Hard Disk for a Virtual Machine provisioned using Vagrant from a Linux base box to run using VirutalBox.

Resize a Hard Disk for a Virtual Machine

Our Virtual Machines are provisioned using Vagrant from a Linux base box to run using VirutalBox. If the Hard Disk space runs out and you cannot remove files to free-up space, you can resize the Hard Disk using some VirtualBox and Linux commands.

Some assumptions

The following steps assume you've got a set-up like mine, where:

@yosemitebandit
yosemitebandit / send_pdf_with_boto_ses.py
Created June 6, 2012 17:56
send PDF attachment with boto and SES
''' quick example showing how to attach a pdf to multipart messages
and then send them from SES via boto
'''
from email.mime.text import MIMEText
from email.mime.application import MIMEApplication
from email.mime.multipart import MIMEMultipart
import boto
@sramana
sramana / graph_coloring.py
Created September 17, 2010 04:09
Python Program for Graph Coloring Problem
colors = ['Red', 'Blue', 'Green', 'Yellow', 'Black']
states = ['Andhra', 'Karnataka', 'TamilNadu', 'Kerala']
neighbors = {}
neighbors['Andhra'] = ['Karnataka', 'TamilNadu']
neighbors['Karnataka'] = ['Andhra', 'TamilNadu', 'Kerala']
neighbors['TamilNadu'] = ['Andhra', 'Karnataka', 'Kerala']
neighbors['Kerala'] = ['Karnataka', 'TamilNadu']