Skip to content

Instantly share code, notes, and snippets.

View lunks's full-sized avatar

Pedro Nascimento lunks

View GitHub Profile
@lunks
lunks / cookie clicker bookmarklet
Last active May 6, 2020 05:38 — forked from met4000/cookie clicker bookmarklet
An autoclick bookmarklet for CC.
@lunks
lunks / _angularjs_and_rails_asset_pipeline.md
Last active September 19, 2015 22:11 — forked from stevenharman/_angularjs_and_rails_asset_pipeline.md
Load the Angular.js $templateCache while building assets for Rails Asset Pipeline. Be sure in require the `templates` module as a dependency of your Angular.js app.

AngularJS + Rails Asset Pipeline updated to Sprockets 3 + other changes

Updates:

  • Sprockets 3 doesn't seem to need me to inject JavascriptHelpers.
  • Using environment[file].to_s to fetch the compiled sources.
  • Everything in my app (templates and scripts) is inside an app/ folder which is my angular app, so I leave that path part out on the $templateCache key
  • I'm only supporting slim templates because I only use slim, but it should fairly easy to add other template engines.
  • The previous script broke on files like course-link.directive.slim. We just remove the .slim extension now.
class Person
def initialize
@attributes = {}
end
def attributes
@attributes.dup.freeze
end
def name
require "money"
class Decorator < BasicObject
undef_method :==
def initialize(component)
@component = component
end
def method_missing(name, *args, &block)
#----------------------------------------------------------------------------
# Git Setup
#----------------------------------------------------------------------------
file '.gitignore', <<-FILE
.DS_Store
log/*.log
tmp/**/*
config/database.yml
db/*.sqlite3
public/uploads/*