Skip to content

Instantly share code, notes, and snippets.

View dannydb's full-sized avatar

Danny DeBelius dannydb

View GitHub Profile
import { downTo } from './helpers';
export class Bottles {
song() {
return this.verses(99, 0);
}
verses(start, end) {
return downTo(start, end)
.map((i) => this.verse(i))
import { downTo } from './helpers';
export class Bottles {
song() {
return this.verses(99,0);
}
verses(start, end) {
const versesToSing = [];
@dannydb
dannydb / grid.js
Created February 12, 2019 21:37
Doxy Grid
import { Platform } from 'react-native'
const GRID_VALUE = 8
const NUDGE_VALUE = 4
const getGridDimension = (increment = 1) => increment * GRID_VALUE
const getNudgeDimension = () => NUDGE_VALUE
const getPlatformMargin = () => {
return Platform.select({

Automate a reminder to pack your laptop

I don't usually take my work laptop home each evening, but once in awhile I do, and a fraction of those times I've neglected to pack the deck the next morning because it's not part of my usual morning routine.

Here's a quick fix, using iCloud reminders, a neat (free!) app called ControlPlane and a couple of short scripts.

1. Install ControlPlane

Get ControlPlane by using Cask:

@dannydb
dannydb / README.md
Last active August 29, 2015 14:21 — forked from mbostock/.block
@dannydb
dannydb / gist:9e8ca69eba06b976da55
Last active December 1, 2017 06:50
Tile map post

Let’s Tesselate

A hexagon tile grid, square tile grid and geographic choropleth map. Maps by Danny DeBelius and Alyson Hurt

A hexagon tile grid, square tile grid and geographic choropleth map. Maps by Danny DeBelius and Alyson Hurt

As the saying goes, nothing is certain in this life but death, taxes and requests for geographic data to be plotted on a map.

When that data is associated with geographic areas, the choropleth map is a tried and true visualization technique, but not without significant dangers depending on the nature of the data and map areas represented. Clarity of mapped state-level data, for instance, is frequently complicated by the reality that most states in the western U.S. carry far more visual weight than the northeastern states.

# Sometimes yosemite crashes with a gunicorn server up
# and when it comes back up there is a python process blocking port 8000
# kill that process with this function
# http://stackoverflow.com/questions/3855127/find-and-kill-process-locking-port-3000-on-mac
function killport() {
lsof -i TCP:$1 | grep LISTEN | awk '{print $2}' | xargs kill -9
}
@dannydb
dannydb / workon_project.applescript
Last active August 29, 2015 14:16
Open tab in iTerm and setup pane for server and git/fab commands
tell application "iTerm"
activate
set projectSlug to the text returned of (display dialog "Which project?" default answer "")
tell the current terminal
activate current session
-- launch dailygraphics tab
@dannydb
dannydb / gist:74399d474ed14da3637b
Created March 6, 2015 20:13
Dailygraphics iTerm
tell application "iTerm"
activate
tell the current terminal
activate current session
-- launch dailygraphics tab
launch session "Default Session"
tell the last session
set name to "1-dailygraphics"
@dannydb
dannydb / Fine Rotate Left
Created September 5, 2014 13:48
powermate scripts
tell application "System Events"
set frontmostProcess to name of first item of (processes whose frontmost is true)
tell process frontmostProcess
tell window 1
set oldSize to get size
-- change + to - for shrinking
-- change 100 to 5 for fine-tune mode
set newWidth to (item 1 of oldSize) - 5
set size to {newWidth, item 2 of oldSize}
end tell