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
(defmacro def.run [sym params & body] | |
(list '.run ;; .run( | |
(list '.module 'js/angular sym) ;; angular.module(sym) | |
(concat ['array] ;; Array.new( | |
(map str params) ;; "$rootScope", "$q" | |
[(concat ['fn params] body)] ;; , function($rootScope, $q) { code; })) | |
) | |
) | |
) |
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
module.exports = (grunt) -> | |
require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks) | |
grunt.initConfig { | |
app: | |
dev: "app" | |
watch: | |
sass: | |
files: ['<%= app.dev %>/**/*.scss'] | |
tasks: ['compass:dist'] |
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
(def.directive cant_catch_me_olivia.board [] | |
(obj :restrict "E" | |
:replace true | |
:templateUrl "partials/board.html" | |
:link (fn [scope element attrs] | |
(let [board (.find element ".board") | |
cells (atom []) | |
each-span (fn [code] (doseq [data @cells] (apply code data)))] | |
(doseq [y (range 0 5)] | |
(let [row (js/$ "<li class='row'><ol class='board-row'></ol></li>") |
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
(defn- map-names [items] | |
(into {} (mapv (fn [item] {(item :name) item}) items)) | |
) | |
(defn- reset-objects! [objects mapped-clj-objects] | |
(.forEach objects | |
(fn [object] | |
; the objects in these happen to be indexed by object.name | |
(let [clj-object (mapped-clj-objects (.-name object))] | |
(doseq [[k v] clj-object] |
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 'csv' | |
fields_to_keep = [ | |
"Backer Id", "Pledge Amount", "Shipping Name", "Shipping Address 1", | |
"Shipping Address 2", "Shipping City", "Shipping State", "Shipping Postal Code", | |
"Shipping Country Name" | |
] | |
sort_result_on = "Backer Id" |
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
module R18n | |
class Translation | |
def iterate(s) | |
root = self | |
s.split('.').each { |key| root = root[key] } | |
root | |
end | |
end | |
end |
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
# | |
# Get SCSS working in Sinatra | |
# | |
configure do | |
Tilt.register 'scss', Tilt::SassTemplate | |
set :sass, Compass.sass_options.merge({:syntax => :scss}) | |
end |
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
function parse_git_branch { | |
ref=$(git symbolic-ref HEAD 2> /dev/null) || return | |
echo " ("${ref#refs/heads/}")" | |
} | |
export PS1="\[\e[0;37m\][\[\e[0;31m\]\u\[\e[1;37m\]@\[\e[0;32m\]\h\[\e[0;37m\]] \[\e[1;37m\]\w\$(parse_git_branch) \$ \[\e[0;37m\]" | |
[[ "${TERM}" == "screen" ]] && echo -n -e '\ek'${HOSTNAME%%.*}'\e\' |
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
function parse_git_branch { | |
ref=$(git symbolic-ref HEAD 2> /dev/null) || return | |
echo " ("${ref#refs/heads/}")" | |
} | |
# Install Local Terminal (Incubation) from the Helios Marketplace | |
# then set an Env variable for your shell for IS_ECLIPSE=yes | |
# and be sure to do /bin/bash -l, too | |
if [ "$IS_ECLIPSE" == "yes" ]; then |
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
// this is a hack until react-native-webpack-server gets updated (and I'm | |
// sure it will soon. :) ) | |
// | |
// you'll need 0.4.0-rc or better of react-native-webpack-server | |
// don't run react-native-webpack-server's server for now, use react-native's | |
// | |
// also, run me in pure node and not babel-node, or react-native will try and | |
// load polyfills that are already loaded. :/ | |
var webpack = require('webpack'); | |
var webpackConfig = require('./webpack.config.js'); |
OlderNewer