Skip to content

Instantly share code, notes, and snippets.

View ppcano's full-sized avatar

Pepe Cano ppcano

View GitHub Profile
@joewest
joewest / gist:1879042
Created February 21, 2012 21:21
config.ru for rake-pipeline with proxy support
require 'rake-pipeline'
require 'rake-pipeline/middleware'
require 'net/http'
require 'net/https'
require 'uri'
module Rack
class Proxy
def initialize(app, project, opts={})
# for good measure
@daily /etc/init.d/weinred restart
Viz.WidgetsController = Ember.ArrayController.extend
init: ->
@refresh()
setInterval (=> @refresh), 5000
refresh: ->
$.ajax
url: @get('src'),
type: "GET",
context: this,
@borismus
borismus / gist:1990752
Created March 7, 2012 03:35
Ember project setup
/static/sass/:
screen.scss: (common stylesheet)
phone.scss, tablet.scss, desktop.scss: (form factor-specific styles)
/static/js/:
libs/: (external libraries - DO NOT MODIFY)
ember-and-friends.js
jquery.js
formfactor.js
views/: (form-factor specific views)
@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: [],
Person = Ember.Object.extend({
fullName: function() {
var gender = this.get('gender'), parts, married;
if (gender === "M") {
parts = ["Mr."];
} else if (gender === "F") {
married = this.get('married');
parts = [married ? "Mrs." : "Ms."];
} else {
PhoneNumber = Ember.Object.extend({
areaCode: null,
number: null
});
Person = Ember.Object.extend({
areaCode: function() {
var areaCodes = {}, phoneNumbers = this.get('phoneNumber');
for (var i=0, l=phoneNumbers.length; i<l; i++) {
@btoone
btoone / curl.md
Last active December 10, 2025 22:00
A curl tutorial using GitHub's API

Introduction

An introduction to curl using GitHub's API.

The Basics

Makes a basic GET request to the specifed URI

curl https://api.github.com/users/caspyin
APPNAME = 'wh'
require 'json'
require 'rake-pipeline-web-filters'
WebFilters = Rake::Pipeline::Web::Filters
class LoaderFilter < WebFilters::MinispadeFilter
def generate_output(inputs, output)
inputs.each do |input|
@tomdale
tomdale / gist:2494968
Created April 26, 2012 01:10
Ember.js View Context Change

View Context Changes

The rules for how Ember.js evaluates Handlebars templates have recently changed, and you may need to update your application's templates to ensure they continue working..

Template Contexts

Remember that a template is always evaluated against a context object. When you render a template, values are looked up from that object. For example:

Hello, {{firstName}} {{lastName}}!