Skip to content

Instantly share code, notes, and snippets.

View 10thfloor's full-sized avatar
💫

Mackenzie 10thfloor

💫
View GitHub Profile
@10thfloor
10thfloor / events.js
Last active November 9, 2016 00:25
Simple event class
export default class Event {
constructor() {
this.handlers = []
}
emit(event, ...args) {
if(this.handlers.event) {
this.handlers[event].forEach((handler, index) => {
handler.apply(this, [...args])
@10thfloor
10thfloor / watch.sh
Last active October 8, 2015 12:53 — forked from mikesmullin/watch.sh
#!/usr/bin/env bash
# script: watch
# author: Mike Smullin <mike@smullindesign.com>
# license: GPLv3
# description:
# watches the given path for changes
# and executes a given command when changes occur
# usage:
# watch <path> <cmd...>
#
$routeProvider.when = (function(when){
var extendedWhen = function(incomingRoute, routeConfig){
// Basic error case.
if(routeConfig.resolve && typeof routeConfig.resolve !== 'object'){
throw new Error('$routeProvider.when: resolve should be \'object\' instead of: ' + typeof config.resolve );
}
routeConfig = routeConfig || {};
routeConfig.resolve = angular.extend(routeConfig.resolve, {
@10thfloor
10thfloor / css_triangle.scss
Created September 10, 2012 17:23
CSS Triangle SASS Mixin!
// add this to block level elements to create a nice triangle!
// derived from http://css-tricks.com/snippets/css/css-triangle/
@mixin css_triangle($dir, $size, $color) {
width: 0;
height: 0;
@if $dir == up {
border-left: $size solid transparent;
@10thfloor
10thfloor / css_splitter.rake
Created July 12, 2012 18:30 — forked from ChristianPeters/css_splitter.rake
Split CSS files so that there are no more than a given number of selectors in one style sheet. This is a tool to cope with Internet Explorer's limitation of max. 4095 selectors per stylesheet.
require 'rake'
require 'css_splitter'
desc 'split css files'
namespace :css do
task :split do
infile = ENV['infile'] || raise("missing infile")
outdir = ENV['outdir'] || File.dirname(infile)
max_selectors = ENV['max_selectors'] || 4095