Skip to content

Instantly share code, notes, and snippets.

View ralfschimmel's full-sized avatar
:octocat:

Ralf Schimmel ralfschimmel

:octocat:
  • Gynzy
  • Nijmegen, the Netherlands
View GitHub Profile
anonymous
anonymous / pivotal_export.php
Created October 3, 2010 14:56
<?php
if (!isset($_SERVER['PHP_AUTH_USER']) || !isset($_SERVER['PHP_AUTH_PW'])) header('WWW-Authenticate: Basic realm="Please enter username and password:"');
else if (auth_attempt_script_login($_SERVER['PHP_AUTH_USER'], $_SERVER['PHP_AUTH_PW'])) {
auth_ensure_user_authenticated();
if (!$_GET['project']) die("missing parameters");
require_once( 'core.php' );
$t_core_path = config_get( 'core_path' );
@ppcano
ppcano / collection_view_should_respond_to_test_event.js
Created November 10, 2011 18:18
Testing sproutcore-touch passing through child elements
require('sproutcore');
require('sproutcore-touch');
var set = SC.set, get = SC.get;
var tapEndWasCalled = true;
module("Touching handlebars tests", {
setup: function() {
console.group(' - Setup for new test');
anonymous
anonymous / Assetfile
Created December 12, 2011 15:53
require "rake-pipeline-web-filters/minispade_filter"
require "rake-pipeline-web-filters/sass_compiler"
require "rake-pipeline-web-filters/ordering_concat_filter"
require "rake-pipeline-web-filters/helpers"
require "json"
class HandlebarsFilter < Rake::Pipeline::Filter
def initialize(&block)
block ||= proc { |input| input.sub(/\.handlebars$/, '.js') }
super(&block)
@dudleyf
dudleyf / gist:1477124
Created December 14, 2011 15:52
Handlebars Rake::Pipeline filter
require "json"
class HandlebarsFilter < Rake::Pipeline::Filter
def initialize(&block)
block ||= proc { |input| input.sub(/\.handlebars$/, '.js') }
super(&block)
end
def generate_output(inputs, output)
inputs.each do |input|
output.write "return Ember.Handlebars.compile(#{input.read.to_json})"
@wagenet
wagenet / Assetfile.rb
Created January 13, 2012 20:37
Ember Handlebars Precompile
require 'execjs'
class HandlebarsFilter < Filter
class << self
def contents
@@contents ||= [File.read("headless-ember.js"), File.read("ember.js")].join("\n")
end
def context
@@context ||= ExecJS.compile(contents)
@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')
@ppcano
ppcano / Makefile
Created January 19, 2012 11:35
assetfile
update:
rm -rf packages/*; \
cp -pr ~/Git/forks/ember.js/packages/* ./packages; \
cp -pr ~/Git/forks/sproutcore-touch/packages/ember-touch ./packages; \
cp -pr ~/Git/emberjs/ember-mk/packages/ember-mk ./packages
@unicolet
unicolet / sproutcore_dev_from_scratch_ubuntu.sh
Last active September 30, 2015 20:48
Sproutcore official and development from scratch on barebone Ubuntu Linux
#
# Use these commands to install sproutcore official (and development version)
# on Ubuntu linux
#
# Tested on Lucid Lynx provisioned by vagrant (http://vagrantup.com/)
#
sudo apt-get install curl
bash -s stable < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer)
source /home/vagrant/.rvm/scripts/rvm
source /home/vagrant/.profile

Recently, we've been working on extracting Ember conventions from applications we're working on into the framework. Our goal is to make it clearer how the parts of an Ember application work together, and how to organize and bootstrap your objects.

Routing

Routing is an important part of web applications. It allows your users to share the URL they see in their browser, and have the same things appear when their friends click on the link.

The Ember.js ecosystem has several great solutions for routing. But, since it is such an important part of most web applications, we've decided to build it right into the framework.

If you have already modeled your application state using Ember.StateManager, there are a few changes you'll need to make to enable routing. Once you've made those changes, you'll notice the browser's address bar spring to life as you start using your app—just by moving between states, Ember.js will update the URL automatically.

@dherman
dherman / emacs-cheat-sheet.md
Created August 2, 2012 16:22
My emacs cheat sheet

In penance for cracking stupid jokes on Twitter, here's my Emacs cheat sheet. Emacs has a steep learning curve, so I've tried to order them by importance so you could learn them in stages.

One overall rule of thumb: pay attention to the minibuffer (the line at the bottom of the editor). It will often guide you through a process, and also gives you hints about what state you're in, such as the middle of a multi-chord sequence.

The other rule of thumb: when in doubt, C-g it out.

Basics (mandatory)

You simply can't get by without having these at your fingertips.