Skip to content

Instantly share code, notes, and snippets.

View dannypage's full-sized avatar
https://danny.page

Danny Page dannypage

https://danny.page
View GitHub Profile
!function() {
var doc = document,
htm = doc.documentElement,
lct = null, // last click target
nearest = function(elm, tag) {
while (elm && elm.nodeName != tag) {
elm = elm.parentNode;
}
return elm;
};
anonymous
anonymous / gist:4331127
Created December 18, 2012 19:27
40 Random Letters and Numbers
''.join(random.sample(string.letters+string.digits, 40))
@dlo
dlo / README.md
Created December 20, 2012 04:42
Apple Crash Report Cleanup Script

A lot of the time, crash reports sent via email get a bit garbled over the wire, and Xcode won't symbolicate them. It turns out that a lot of email clients (including Apple Mail) are the cause of this.

This script takes a crash report and cleans it up so that Xcode likes it.

Usage:

$ cat example.crash | cleanup.py
@wrr
wrr / index.html
Last active May 14, 2019 00:27
Random walk illustrated with D3.
<!DOCTYPE html>
<!-- By Jan Wrobel. See it working at:
http://mixedbit.org/blog/2013/02/10/random_walk_illustrated_with_d3.html
-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<title>Random walk</title>
@jasondavies
jasondavies / README.md
Last active June 13, 2019 23:16 — forked from mbostock/.block
Vertical Bullet Charts
@MonkmanMH
MonkmanMH / gist:5802497
Created June 18, 2013 03:30
Annotating select points on an X-Y plot using ggplot2
#
# for details see
# http://bayesball.blogspot.ca/2013/06/annotating-select-points-on-x-y-plot.html
#
# load the ggplot2 and grid packages
library(ggplot2)
library(grid)
# read data (note csv files are renamed)
tbl1 = read.csv("FanGraphs_Leaderboard_h.csv")
tbl2 = read.csv("FanGraphs_Leaderboard_d.csv")
@d3lta-v
d3lta-v / ROT13+ROT5.js
Last active July 14, 2020 11:54
Simple Javascript implementation of ROT13+ROT5 ciphers.
// Simple ROT13+ROT5 cipher (Javascript implementation)
// Copyright StatiX Industries 2013 (MIT License)
//This is the alphabet array
var alphaBetString = "A B C D E F G H I J K L M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z";
var alphaBetTable = alphaBetString.split(" ");
//This is the lookup table/array for the ROT13 characters
var rot13String = "N O P Q R S T U V W X Y Z A B C D E F G H I J K L M n o p q r s t u v w x y z a b c d e f g h i j k l m";
var rot13Table = rot13String.split(" ");
@busterbenson
busterbenson / markov_tweets.rb
Created September 25, 2013 05:05
How I do @buster_ebooks.
#!/usr/bin/ruby
# Make sure you have these gems installed
require 'rubygems'
require 'thread'
require 'csv'
require 'twitter'
require 'marky_markov'
# Create a new Twitter account that you'd like to have your auto-tweets posted to
@mdirienzo
mdirienzo / README.md
Last active December 2, 2020 08:04
Progress Bars - An animated progress bar widget for Dashing.

Progress Bar Widget

Description

A widget made for Dashing. This widget shows multiple animated progress bars and reacts dynamically to new information being passed in. Anything with a current state and with a projected max/goal state can easily be represented with this widget. Some sample ideas would be to show progress, completion, capacity, load, fundraising, and much more.

Features

  • Animating progress bars - Both the number and bar will grow or shrink based on new data that is being passed to it.
  • Responsive Design - Allows the widget to be resized to any height or width and still fit appropriately. The progress bars will split up all available space amongst each other, squeezing in when additional progress bars fill the widget.
@blacktm
blacktm / install_ruby_rpi.sh
Last active May 26, 2024 15:13
A Bash script to install Ruby on the Raspberry Pi
#!/bin/bash
# --------------------------------------------------------------------------------------------
# Installs Ruby using rbenv/ruby-build on the Raspberry Pi (Raspbian)
#
# Run from the web:
# bash <(curl -s https://gist.githubusercontent.com/blacktm/8302741/raw/install_ruby_rpi.sh)
# --------------------------------------------------------------------------------------------
# Set the Ruby version you want to install