Skip to content

Instantly share code, notes, and snippets.

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

Trek Glowacki trek

🏳️‍🌈
View GitHub Profile
@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)
@coop
coop / view.handlebars
Created July 23, 2012 09:17
Getting access to form properties in Ember.js
<form>
<div>
<label for="name">Name</label>
{{view Ember.TextField valueBinding="view.name"}}
</div>
<div>
<label for="application">Application</label>
{{view Ember.TextField valueBinding="view.file" type="file"}}
</div>
@karmi
karmi / .gitignore
Created August 16, 2012 12:00
Ember.js application with elasticsearch persistence and Goliath based proxy [http://www.elasticsearch.org/tutorials/2012/08/22/javascript-web-applications-and-elasticsearch.html]
.DS_Store
tmp/
@charlesjolley
charlesjolley / dev_view.coffee
Created August 21, 2012 03:57
Adding event locks to Ember
# example view implements a simple dragging for mouse events.
Wall.DevView = Ember.View.extend
mouseDown: (ev) ->
ev.dispatcher.lock @, 'mouseMove', 'mouseUp'
@_mouseDown = @$().offset()
@_mouseDown.pageX = ev.pageX
@_mouseDown.pageY = ev.pageY
@_mouseDown.dispatcher = ev.dispatcher
console.log 'mouseDown'
var fs = require('fs');
var vm = require('vm');
var log = console.log;
var emberjs = fs.readFileSync('client/code/libs/ember-1.0.pre.min.js', 'utf8');
var handlebarsjs = fs.readFileSync('client/code/libs/handlebars-1.0.0.beta.6.js', 'utf8');
var system = require('../system');
@ma11hew28
ma11hew28 / 1.rvm_ruby_install.log
Last active September 16, 2019 07:49
How to Install RVM, Ruby, and Gems without Xcode Command Line Tools
# How to Install RVM, Ruby, and Gems without Xcode Command Line Tools
# ===================================================================
#
# Mac OS X 10.8.2 (12C60) (Mountain Lion)
# Xcode 4.5 (4G182)
#
# While attempting to `rvm pkg install openssl`, I had encountered the error:
# > cryptlib.h:62:20: error: stdlib.h: No such file or directory
# But, the commands & ouput below show how I worked around the issue.
#
@jergason
jergason / view.coffee
Created November 9, 2012 15:48
Better Child Views in Backbone
# Base view class that all views extend
# NOTE: This is from real production code, so it has some messiness for
# dealing with real production issues.
View = Backbone.View.extend
initialize: (@model) ->
@render
super
@josegonzalez
josegonzalez / access.lua
Created December 3, 2012 18:26
Simple lua file enabling oauth support for nginx via nginx-lua and access_by_lua.
- certain endpoints are always blocked
if nginx_uri == "/_access_token" or nginx_uri == "/_me" then
ngx.exit(403)
end
-- import requirements
local cjson = require "cjson"
-- setup some app-level vars
local app_id = "APP_ID"