This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export default class Event { | |
constructor() { | |
this.handlers = [] | |
} | |
emit(event, ...args) { | |
if(this.handlers.event) { | |
this.handlers[event].forEach((handler, index) => { | |
handler.apply(this, [...args]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# script: watch | |
# author: Mike Smullin <[email protected]> | |
# license: GPLv3 | |
# description: | |
# watches the given path for changes | |
# and executes a given command when changes occur | |
# usage: | |
# watch <path> <cmd...> | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$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, { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
NewerOlder