Skip to content

Instantly share code, notes, and snippets.

View trek's full-sized avatar
🏳️‍🌈

Trek Glowacki trek

🏳️‍🌈
View GitHub Profile
manager dist manifest export ignore include entry
npm npm package.json cjs .npmignore #main
bower git bower.json umd #ignore #main
component git component.json umd #files #main
spm git package.json#spm umd .spmignore #output #main
packagist git composer.json umd
ender npm package.json cjs .npmignore #ender
dojo ??? package.json#dojoBuild umd #dojoBuild
jspm npm/git package.json#jspm any #ignore #files #main
@chrisk
chrisk / cucumber_fakeweb_hook.rb
Created May 7, 2010 02:57
Using FakeWeb to stub out HTTP requests made by a server process from Cucumber's remote runners (Selenium, Mechanize, etc.)
# config/initializers/cucumber_fakeweb_hook.rb
# If this looks like a test server process, make its FakeWeb available to other
# processes via DRb. That way the test runner (which runs in a separate process)
# can dynamically register stubs for this server to use.
if Rails.env.cucumber? && defined?(PhusionPassenger)
require 'drb'
require 'fakeweb'
DRb.start_service("druby://localhost:30010", FakeWeb)
@crofty
crofty / sproutcore_setup.mdown
Created June 15, 2011 20:17
Getting up and running with Sproutcore - 15/06/2011

Steps required for getting tests running

git clone git://github.com/sproutcore/sproutcore20.git
cd sproutcore20
echo "rvm use 1.9.2@sproutcore" > .rvmrc
cd -
cd sproutcore20
gem update --system 1.7.2
bundle install
gem uninstall spade # Version 0.1.0 isn't working for me yet
@dudleyf
dudleyf / AssetFile
Created January 4, 2012 00:46 — forked from nicholasjhenry/AssetFile
AssetFile for Rake Pipeline for use with ember.js/handlebars
require "json"
require "rake-pipeline-web-filters"
input "assets"
output "public"
class HandlebarsFilter < Rake::Pipeline::Filter
def initialize(&block)
block ||= proc { |input| input.sub(/\.handlebars$/, '.js') }
super(&block)
@garth
garth / Jakefile.js
Created January 16, 2012 18:37 — forked from wagenet/Assetfile.rb
Precompile .handlebars templates with Jake (nodejs)
var fs = require('fs')
var vm = require('vm')
var handlebarsjs = fs.readFileSync('path/to/handlebars.js', 'utf8')
var emberjs = fs.readFileSync('path/to/ember.js', 'utf8')
var templatesDir = 'path/to/template/dir'
desc('Compile all .handlebars templates')
task({ 'handlebars': [] }, function () {
process.stdout.write('Compiling .handlebars templates')
@jpoz
jpoz / upload_proxy.rb
Created February 12, 2012 23:20
Goliath File Upload Proxy Server
require 'goliath'
require 'em-synchrony/em-http'
class UploadProxy < Goliath::API
def on_headers(env, headers)
env.logger.info 'received headers: ' + headers.inspect
env['async-headers'] = headers
end
@ghempton
ghempton / bound_helper.js
Created March 11, 2012 20:55
Ember Bound Handlebars Helper Utility
// This file contains utilities for creating bound helpers
// For reference: https://github.com/wagenet/ember.js/blob/ac66dcb8a1cbe91d736074441f853e0da474ee6e/packages/ember-handlebars/lib/views/bound_property_view.js
Ember.Handlebars.BoundHelperView = Ember.View.extend(Ember._Metamorph, {
context: null,
options: null,
property: null,
// paths of the property that are also observed
propertyPaths: [],
@robharper
robharper / Assetfile
Created May 16, 2012 17:55
Using rake-pipeline and a modified 'Neuter' filter for JS library development
require "rake-pipeline-web-filters"
require "neuter_plus_filter"
input 'src' do
output 'build'
match '**/main.js' do
filter(Rake::Pipeline::Web::ExtraFilters::NeuterPlusFilter,
# Possibly depend on JS files within same or subdirectories
:additional_dependencies => proc { |input|
Dir.glob(File.join(File.dirname(input.fullpath),'**','*.js'))
@ghempton
ghempton / ember-controllers.md
Created July 18, 2012 21:16
Ember.js Controller Brainstorm

Ember.js Controller Brainstorm

Currently, there are several awkward points to Ember.js controllers. Namely:

  1. Passing controllers around to view's not instantiated by the routing system is hard.
  2. Non-singleton controllers are very difficult to manage (e.g. #each where each view has it's own controller).
  3. Sharing data between controllers is difficult.

Solution for 1 and 2: Controllers are lazily created by views

Iridium: The Next Step Forward

Proposed changes/goals/musings

  • Make an iridium command
  • Enable: iridium app your_app_name so it generates a complete application structure
  • Enable: iridium server # starts a stupid development server serving /site or whatever the application config is
  • Enable: iridium generate model|view|template|controller|template|state
  • Make testing work with casperjs for integration tests and unit tests
  • Tests written in Coffescript by default (casper automatically compiles cs so no extra work needed)