Skip to content

Instantly share code, notes, and snippets.

View alvaromuir's full-sized avatar

Álvaro Muir alvaromuir

View GitHub Profile
@alvaromuir
alvaromuir / Gruntfile.coffee
Last active December 23, 2015 16:09
Ember & Jade Grunt configuration. Renders *.jade files to *.hbs from app/template and adds them to Ember.TEMPLATE
"use strict"
# # Globbing
# for performance reasons we're only matching one level down:
# 'test/spec/{,*/}*.js'
# use this if you want to recursively match all subfolders:
# 'test/spec/**/*.js'
module.exports = (grunt) ->
# show elapsed time at the end
@alvaromuir
alvaromuir / Index.jade
Last active December 23, 2015 16:09
Ember + RequireJS Index.jade. Includes '#webapp' div ID to use for Ember root element.
!!! 5
//if lt IE 7
html.no-js.lt-ie9.lt-ie8.lt-ie7
//if IE 7
html.no-js.lt-ie9.lt-ie8
//if IE 8
html.no-js.lt-ie9
// [if gt IE 8] <!
html.no-js
// <![endif]
@alvaromuir
alvaromuir / Gruntfile.coffee
Last active December 24, 2015 20:09
Standard webapp Gruntfile with Jade
# Generated on 2013-10-06 using generator-webapp 0.4.2
"use strict"
# # Globbing
# for performance reasons we're only matching one level down:
# 'test/spec/{,*/}*.js'
# use this if you want to recursively match all subfolders:
# 'test/spec/**/*.js'
module.exports = (grunt) ->
@alvaromuir
alvaromuir / TumblrDemo.html
Last active December 25, 2015 01:09
Tumblr demo in html, sans js or iframes.
<!doctype html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]-->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Alvaro Muir | Thought You'd Wanna Know</title>
<meta name="description" content="Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.">
<link rel="shortcut icon" href="http://assets.tumblr.com/images/default_avatar_128.png">
@alvaromuir
alvaromuir / _custom.scss
Created November 29, 2013 22:42
FlatUI Colors
// Colors:
$TURQUOISE: #1abc9c;
$GREENSEA: #16a085;
$EMERALD: #2ecc71;
$NEPHRITIS: #27ae60;
$PETERRIVER: #3498db;
$BELIZEHOLE: #2980b9;
$AMERGYST: #9b59b6;
$WISTERIA: #8e44ad;
$WETASPHALT: #34495e;
@alvaromuir
alvaromuir / Ordinals.py
Last active December 30, 2015 01:48
Python Ordinals
def ordinal(n):
if 4 <= n <= 20 or 24 <= n <= 30:
return n + 'th'
else:
return str(n) + ["st", "nd", "rd"][n % 10 - 1]
@alvaromuir
alvaromuir / snippets
Created January 3, 2014 22:21
Snippets
// Remove timestamp from NSLog
#define NSLog(FORMAT, ...) printf("%s\n", [[NSString stringWithFormat:FORMAT, ##__VA_ARGS__] UTF8String]);
@alvaromuir
alvaromuir / obj-c_marcos
Created January 5, 2014 17:10
Some common Objective-C Macros
#define PI 3.141592654
#define TWO_PI 2.0 * PI
#define SQUARE(x) ((x)*(x))
#define CUBE(x) ((x)*(x)*(x))
#define IS_LEAP_YEAR(y) y % 4 == 0 && y % 100 != 0 || y % 400 == 0
#define IS_LOWER_CASE(x) ( ((x) >= 'a') && ((x) <= 'z'))
#define TO_UPPER(x) (IS_LOWER_CASE(x) ? (x) - 'a' + 'A': (x))
#define INCHES_PER_CENT 0.394
#define CENT_PER_INCH (1/INCHES_PER_CENT)
@alvaromuir
alvaromuir / gist:8492876
Created January 18, 2014 16:39
Social Web App idea #MLKDreamCode
Yelp meets kickstarter for social good.
People should be able to post information and images about things they want to change in their community.
Requires social login to ensure the word is spread
Gamaified by karma points.
Gains attention of local governing bodies, community members, neighbors
@alvaromuir
alvaromuir / rPackages.r
Last active January 15, 2016 01:49
R Setup packages
# $ brew install unixodbc on mac
install.packages("devtools")
devtools::install_github("selva86/InformationValue")
install.packages(c("RODBC","RPostgreSQL","RSQLite","RMySQL",
"xlsx","XLConnect","foreign",
"dplyr","tidyr","stringr","lubridate","reshape",
"ggplot2","ggvis","rgl","htmlwidgets","googleVis","RColorBrewer",