Skip to content

Instantly share code, notes, and snippets.

View enyo's full-sized avatar
🙌
Primarily working on Pausly

Matias Meno enyo

🙌
Primarily working on Pausly
View GitHub Profile
// ==========================================================================
// Project: Inc.CheckboxListItemView
// Copyright: ©2010 My Company, Inc.
// ==========================================================================
/*globals Inc */
/** @class
(Document Your View Here)
@enyo
enyo / package.json
Created January 5, 2014 20:50
gulp package.json
{
"name": "project-tools"
, "version": "0.0.1-dev"
, "private": true
, "devDependencies": {
"gulp": "*",
"gulp-myth": "*"
}
}
@enyo
enyo / changelog.sh
Created July 3, 2013 13:04
Print changelog to use for Github releases. (Goes through all commits, and shows the one with a #changelog hashtag)
#!/bin/bash
#echo git log $1...$2 --pretty=format:'<li> <a href="http://github.com/jerel/<project>/commit/%H">view commit &bull;</a> %s</li> ' --reverse | grep "#changelog"
firstTag=$(git tag | tail -2 | head -1)
secondTag=$(git tag | tail -1)
cmd=$(basename $0)
if [ "$1" == "-h" ]
then

EventListener Polyfill

Is IE8 your new IE6? Level the playing field with polyfills.

This script polyfills addEventListener, removeEventListener, and dispatchEvent. It is less than half a kilobyte minified and gzipped.

addEventListener

addEventListener registers a single event listener on a single target.

//addEventListener polyfill 1.0 / Eirik Backer / MIT Licence
(function(win, doc){
if(win.addEventListener)return; //No need to polyfill
function docHijack(p){var old = doc[p];doc[p] = function(v){return addListen(old(v))}}
function addEvent(on, fn, self){
return (self = this).attachEvent('on' + on, function(e){
var e = e || win.event;
e.preventDefault = e.preventDefault || function(){e.returnValue = false}
e.stopPropagation = e.stopPropagation || function(){e.cancelBubble = true}
@enyo
enyo / storefile.js
Last active December 10, 2015 22:29
var path = require("path");
exports.media = function(req, res, next) {
var file = req.files.media_upload;
// code to handle file here:
// file should already be in the right location
// The path, this file has been saved at should be:
file.path;
// To get only the filename of this path:
App.Router.map (match) ->
match("/").to "finances"
match("/finances").to "finances", (match) ->
match("/").to "listFinancialEvents"
match("/:financial_event_id").to "financialEvent"
App.Router = Ember.Router.extend
enableLogging: yes
showFinancialTransfers: Ember.State.transitionTo "finances"
{
"name": "boot",
"description": "Lisa's website",
"version": "0.0.1",
"private": true,
"dependencies": {
"enyo/opentip": "*",
"enyo/dropzone": "*"
},
"scripts": [
@enyo
enyo / app.js
Created December 18, 2012 12:42
var myCoolFunc = require("my-mod");
myCoolFunc("yeah");