Skip to content

Instantly share code, notes, and snippets.

@rocknrollMarc
rocknrollMarc / .bashrc
Created December 28, 2015 17:59 — forked from vsouza/.bashrc
Golang 1.5 setup in Mac OSX with HomeBrew. Set `GOPATH` and `GOROOT` variables in zshell or bash.
# Set variables in .bashrc file
# don't forget to change your path correctly!
export GOPATH=$HOME/golang
export GOROOT=/usr/local/opt/go/libexec
export PATH=$PATH:$GOPATH/bin
export PATH=$PATH:$GOROOT/bin
@rocknrollMarc
rocknrollMarc / gist:d93c220e12a6115dcbf2
Last active September 25, 2015 13:41 — forked from akolosov/gist:cedaac86b333a4ced95f
vim 7.4 with lua+GUI on Ubuntu 14.04
#!/bin/sh
sudo apt-get remove --purge vim vim-runtime vim-gnome vim-tiny vim-common vim-gui-common
sudo apt-get install liblua5.1-dev luajit libluajit-5.1 python-dev ruby-dev libperl-dev mercurial libncurses5-dev libgnome2-dev libgnomeui-dev libgtk2.0-dev libatk1.0-dev libbonoboui2-dev libcairo2-dev libx11-dev libxpm-dev libxt-dev
sudo mkdir /usr/include/lua5.1/include
sudo ln -s /usr/include/luajit-2.0 /usr/include/lua5.1/include
cd ~
git clone https://github.com/vim/vim.git

AngularJS + Rails Asset Pipeline

This is my hand-rolled solution for getting Angular assets (Controllers, Models, Directives, Templates, etc.) integrated into the Rails Asset Pipeline.

Templates and the $templateCache

Of particular note: this hack will also load the AngularJS $templateCache with your templates, while allowing you to use Slim, ERB, etc. to write your templates.

'use strict'
var gulp, sass, babelify, browserify, watchify, source, util;
gulp = require('gulp');
sass = require('gulp-sass');
babelify = require('babelify')
browserify = require('browserify');
watchify = require('watchify');
source = require('vinyl-source-stream');
{
"app/assets/javascripts/router.js.coffee": {
"command": "jini"
},
"app/controllers/api/v1/*_controller.rb": {
"command": "apicontroller",
"alternate": "spec/controllers/api/v1/%s_controller_spec.rb",
"template": "class Api::V1::%SController < ApplicationController\n respond_to :json\nend"
},
"app/assets/javascripts/models/*.js.coffee": {
require "spec_helper"
describe ExampleController do
context "GET #index" do
let(:resources) { FactoryGirl.create_list(:resource) }
before do
get :index
end
@rocknrollMarc
rocknrollMarc / .guard.rb
Last active August 29, 2015 14:13 — forked from doitian/.guard.rb
require 'guard/notifier'
notifiers_options = {
:emacs => {
:fontcolor => "#acbc90",
:default => "#1e2320",
:success => "#013009",
:failed => "#310602",
:pending => "#534626"
},
@rocknrollMarc
rocknrollMarc / apps.rb
Created September 1, 2014 15:58 — forked from achiurizo/apps.rb
# foo.rb
class Foo < ::Sinatra::Base
class << self
def dependencies; []; end
def setup_application!; end
end
get '/' do
'wubwub'
Large Object Motions:
(
)
{
}
[[
[]
][
]]
[m
# mongo_template.rb
# remove unneeded defaults
run "rm public/index.html"
run "rm public/images/rails.png"
run "rm public/javascripts/controls.js"
run "rm public/javascripts/dragdrop.js"
run "rm public/javascripts/effects.js"
run "rm public/javascripts/prototype.js"