Skip to content

Instantly share code, notes, and snippets.

View toadkicker's full-sized avatar
🏠
Let's fix some stuff

Todd Baur toadkicker

🏠
Let's fix some stuff
View GitHub Profile
@toadkicker
toadkicker / circle.yml
Last active August 29, 2018 15:17
CircleCI 2.0 configuration for Ruby on Rails 5.1+ with headless chromedriver
# Ruby CircleCI 2.0 configuration file
#
# Check https://circleci.com/docs/2.0/language-ruby/ for more details
#
version: 2
jobs:
build:
docker:
# specify the version you desire here
- image: circleci/ruby:2.5.1-node-browsers
(head -n 2 <file> && tail -n +3 <file> | sort) > newfile
@toadkicker
toadkicker / README.md
Last active January 22, 2016 17:49
Environment specific configurations with Gulp for Angular JS (but any old js framework can use this)

To use this task, export MYAPP_ENV=development and call gulp env

@toadkicker
toadkicker / zindex.scss
Last active May 6, 2024 21:42 — forked from fat/gist:1f6da6b3bd0311a1f8a0
medium's z-index scale
// Copyright 2014 A Medium Corporation
//
// z-index.less
// Medium.com's z-index scale. Z-index values should always be defined in z-index.less. This
// allows us to at a glance determine relative layers of our application and prevents bugs
// arrising from arbitrary z-index values. Do not edit the z-index scale! Only add application
// scoped z-index values.
//This is the SASS version modified by @toadkicker.
@toadkicker
toadkicker / README.md
Last active September 19, 2016 18:59
The Perfect Nginx / Node Server

The Perfect Node / Nginx Server

  • Ubuntu 14.10 64 bit
  • Node 0.10.x from source
  • Nginx from source with SPDY & Pagespeed support

Assumes you're doing everything under /home/ubuntu

OS configuration

@toadkicker
toadkicker / gist:2ec47334d42cae7abfca
Created September 18, 2014 13:39
takes a large array, splitting into an array of arrays based on chunkSize
Array.prototype.chunk = function (chunkSize) {
var array = this;
return [].concat.apply([],
array.map(function (elem, i) {
return i % chunkSize ? [] : [array.slice(i, i + chunkSize)];
})
);
}
{
"vars": {
"@gray-darker": "lighten(#000, 13.5%)",
"@gray-dark": "lighten(#000, 20%)",
"@gray": "lighten(#000, 33.5%)",
"@gray-light": "lighten(#000, 46.7%)",
"@gray-lighter": "lighten(#000, 93.5%)",
"@brand-primary": "#428bca",
"@brand-success": "#5cb85c",
"@brand-info": "#5bc0de",
@toadkicker
toadkicker / gist:10942948
Last active August 29, 2015 13:59
boilerplate enable/disable button functions
function enableButton(el) { //el = '[attr="value"]'
//make it optional to send an el
var ele = document.querySelectorAll(el) || document.querySelectorAll('[type="submit"]');
if(ele.length === 0) { console.log('enableButton called but no button was found in the dom'); return; }
ele.innerHeight = ele.attr.getValue("data-btn-enabled-text");
ele.classList.remove("disabled");
ele.removeAttr('disabled');
}
function disableButton(el) {
@toadkicker
toadkicker / gist:8996196
Created February 14, 2014 05:20
Calculate age from birthdate
function getAge(dateString) {
var today = new Date();
var birthDate = new Date(dateString);
var age = today.getFullYear() - birthDate.getFullYear();
var m = today.getMonth() - birthDate.getMonth();
if (m < 0 || (m === 0 && today.getDate() < birthDate.getDate())) {
age--;
}
return age;
}