Skip to content

Instantly share code, notes, and snippets.

View aboutaaron's full-sized avatar

Aaron Williams aboutaaron

View GitHub Profile
# https://gist.github.com/1214011
module WillPaginate
module ActionView
def will_paginate(collection = nil, options = {})
options[:renderer] ||= BootstrapLinkRenderer
super.try :html_safe
end
class BootstrapLinkRenderer < LinkRenderer
cd ~
sudo apt-get update
sudo apt-get install openjdk-7-jre-headless -y
### Check http://www.elasticsearch.org/download/ for latest version of ElasticSearch and replace wget link below
# NEW WAY / EASY WAY
wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-0.90.0.deb
sudo dpkg -i elasticsearch-0.90.0.deb
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="keywords" lang="de" content="Zeitleiste, Zeitlinie, Zeitkarte, Geschichte, Chronologie">
<meta name="keywords" lang="en" content="Timeline, Timemap, History, Chronology">
<title>Timeline - Proof-of-concept</title>
<!-- That's my local d3 path. When working locally, use your local path. -->
/* USAGE:
$(function(){
var steps = new Stepper("#steps");
steps.addSlide(1, function(){ this.canvas.text("slide 1"); });
steps.addSlide(2, function(){ this.canvas.text("slide 2"); });
steps.go();
});
*/
#!/bin/sh
echo "updating ubuntu"
sudo apt-get -qq update
sudo apt-get -qq upgrade
# development
echo "installing development tools"
sudo apt-get -qq install build-essential
/*!
* toggleAttr() jQuery plugin
* @link https://gist.github.com/aboutaaron/6916c539db4ee9f66d51
* @description .toggleClass() but for attrs. Useful for toggling classes with SVGs or anything that's not a class
* @author Aaron Williams <http://aboutaaron.com/>
* @thanks: Mathias Bynens <http://mathiasbynens.be/> for original
*/
jQuery.fn.toggleAttr = function(attr, value) {
return this.each(function() {
var $this = $(this);
@aboutaaron
aboutaaron / onpubcom_array_date_sort.js
Created January 25, 2016 21:35 — forked from onpubcom/onpubcom_array_date_sort.js
How to Sort an Array of Dates with JavaScript
<script type="text/javascript">
// First let's create an array of JavaScript Date
// objects.
// More info about the Date class:
// http://w3schools.com/js/js_obj_date.asp
var dates = [
new Date(2010, 4, 10, 10, 07, 16),
new Date(2010, 4, 8, 9, 16, 09),
new Date(2010, 3, 30, 0, 15, 49),
function Chart() {
var data = [];
var margin = {
top: 10,
right: 10,
bottom: 10,
left: 10
}
@aboutaaron
aboutaaron / .block
Last active January 19, 2017 03:42 — forked from micahstubbs/.block
world map 02 update to d3 v4
height: 510
border: no
license CC0-1.0
@aboutaaron
aboutaaron / Dockerfile
Created January 30, 2018 21:02 — forked from remarkablemark/Dockerfile
Install node and npm with nvm using Docker.
# set the base image to Debian
# https://hub.docker.com/_/debian/
FROM debian:latest
# replace shell with bash so we can source files
RUN rm /bin/sh && ln -s /bin/bash /bin/sh
# update the repository sources list
# and install dependencies
RUN apt-get update \