Skip to content

Instantly share code, notes, and snippets.

View arboleya's full-sized avatar

Anderson Arboleya arboleya

View GitHub Profile
@arboleya
arboleya / polvo-skel
Last active December 24, 2015 16:09
Simple shell script to scaffold a very simple app skeleton to be built using Polvo.
#!/bin/sh
# NOTES:
# - This script takes only one argument (desired path to create the app)
# - It uses uses coffeescript, stylus and jade to as sample files/code
# - Its intended to be just an example for getting started, and nothing more
# - For more info on Polvo, check the project Site and README:
# http://polvo.io
# https://github.com/polvo/polvo
@arboleya
arboleya / microevent.coffee
Last active December 11, 2015 01:08
MicroEvent in CoffeeScript.
###
Port of MicroEvent in Coffeescript with some naming modifications
and a new 'once' method.
Original project:
https://github.com/jeromeetienne/microevent.js
###
class MicroEvent
_init:-> @_listn or @_listn = {}
_create:(e)-> @_init()[e] or @_init()[e] = []
@arboleya
arboleya / ns.js
Last active December 10, 2015 17:08 — forked from giuliandrimba/namespace.js
Simple namespace definer.
/*
USAGE:
# at window
ns( 'my.namespace' ).MyClass = ...
# at app obj
var app = {}
ns( 'my.namespace', app ).MyClass = ...
*/
@arboleya
arboleya / setup-serpentem-workbench.sh
Last active December 10, 2015 06:08
This gist will setup all the serpentem's repos connected, it incluses `fs-util`, `coffee-toaster`, `theoricus` `and `theoricus-demo-app`. Read all the code and comments to be apart everything.
# Basic configs
USER='serpentem'
NPM='sudo npm'
# Initializes the repo (cloning, remotes, etc)
function clone()
{
repo=$1
remotes=$2
npmlink=$3
@arboleya
arboleya / compiler.coffee
Created November 22, 2012 11:51
Custom compiling routine using Coffee Toaster under the hood, injecting javascript's HEADER and FOOTER code to you final JS output file.
###
This file replaces your 'toaster.coffee' config file, you'll not need
that anymore since the config is passed to Toaster as a hash/object.
Keep in mind that in order for this to work, you'll have to use toaster
as a dependency, which can be easily achieved putting the provided
'package.json' file in your base dir and running 'npm install' to install
toaster locally. Or just enter your project folder and run
'npm install coffee-toaster' (not recommend but work as well)
@arboleya
arboleya / pvt_access_modifier_cs.coffee
Created August 10, 2012 14:20
Private methods/properties in CoffeeScript.
# PRIVATE METHODS/PROPERTIES - COFFEESCRIPT
# ------------------------------------------------------------------------------
# Simple hack to protect private methods and properties from outside classes,
# all props and methods starting with '_' will be unaccessible from outside.
class AccessModifiers
@for:( scope )->
api = {}