Skip to content

Instantly share code, notes, and snippets.

View nook-scheel's full-sized avatar

Nook Scheel nook-scheel

View GitHub Profile
Index: sapi/cli/config.w32
===================================================================
--- sapi/cli/config.w32 (revision 308839)
+++ sapi/cli/config.w32 (working copy)
@@ -6,7 +6,8 @@
ARG_ENABLE('cli-win32', 'Build console-less CLI version of PHP', 'no');
if (PHP_CLI == "yes") {
- SAPI('cli', 'php_cli.c', 'php.exe');
+ SAPI('cli', 'php_cli.c php_http_parser.c php_cli_server.c', 'php.exe');
@nook-scheel
nook-scheel / clean-use.php
Created December 12, 2011 07:24 — forked from ezzatron/clean-use.php
Script to clean unnecessary PHP use statements
#!/usr/bin/env php
<?php
$paths = array();
if (isset($_SERVER['argv']))
{
$paths = $_SERVER['argv'];
array_shift($paths);
if (!$paths)
@nook-scheel
nook-scheel / example.conf
Created April 2, 2012 08:43 — forked from cobbweb/example.conf
Nginx and PHP-FPM
server {
listen 8080;
server_name example.dev www.example.dev;
location / {
root /Users/Cobby/Sites/Example;
if ($host = 'www.example.dev' ) {
rewrite ^/(.*)$ http://example.dev:8080/$1 permanent;
}
@nook-scheel
nook-scheel / ember-precompile.js
Created May 11, 2012 12:44
Precompile .handlebars templates with node js
var fs = require('fs');
var vm = require('vm');
var emberjs = fs.readFileSync('public/javascripts/vendor/ember-0.9.5.min.js', 'utf8');
var templatesDir = 'templates';
var destinationDir = 'public/javascripts/templates';
function compileHandlebarsTemplate(templatesDir, fileName) {
var file = templatesDir + '/' + fileName;

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.

@nook-scheel
nook-scheel / mixins.coffee
Created July 19, 2012 06:17
Using Ember.js Mixins
Lazier.CloseField = Ember.Mixin.create({
focusOut: ->
this.set('isEditing', false)
keyUp: (evt) ->
controller = Lazier.selectedProjectController
if evt.keyCode == 13
this.set('isEditing', false)
else
controller.content.set('isDirty', true)
@nook-scheel
nook-scheel / ps.sh
Created July 26, 2012 17:53 — forked from tj/ps.sh
function git_branch {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\ \(\1\)/'
}
PS1=" λ \W\$(git_branch): "
PS2=" | "
@nook-scheel
nook-scheel / mountain-lion-brew-setup.markdown
Created July 26, 2012 21:05 — forked from myobie/mountain-lion-brew-setup.markdown
Get Mountain Lion and Homebrew to Be Happy

Get Mountain Lion and Homebrew to Be Happy

1) Install XCode 4.4 into /Applications

Get it from http://developer.apple.com. You will not be able to submit apps to any stores using this XCode version, so turn away if that is something you might want to do.

2) Install Command Line Tools

In XCode's Preferences > Downloads you can install command line tools.

@nook-scheel
nook-scheel / DejaVuSansMono-Bold-Powerline.ttf
Created September 3, 2012 08:01
DejaVu Sans Mono patched for vim-powerline
@nook-scheel
nook-scheel / ember-store.js
Created September 17, 2012 17:19
Ember-Data Example
// <== BOOTSTRAP
var App = Ember.Application.create();
App.stateManager = Ember.StateManager.create();
DS.fixtureAdapter.createRecord = function(store, type, record) {
var json = record.toJSON();
json.id = 1;
store.didCreateRecord(record, json);