Skip to content

Instantly share code, notes, and snippets.

View pinyin's full-sized avatar
🎯
Focusing

Bao Bo pinyin

🎯
Focusing
View GitHub Profile
@pinyin
pinyin / intention.coffee
Last active August 29, 2015 14:14
intention.coffee
# WIP
# License: Mozilla Public License, version 2.0
xhr = require 'xhr'
stringify = require 'json-stable-stringify'
status_codes = require './status_codes.coffee'
# TODO do we need GC ?
@pinyin
pinyin / initial.cjsx
Created January 14, 2015 13:50
React component port for the initial js module https://github.com/judesfernando/initial.js. Create Gmail-alike text avatars
React = require 'react'
module.exports = React.createClass
render: ->
colors = ["#1abc9c", "#16a085", "#f1c40f", "#f39c12", "#2ecc71", "#27ae60",
"#e67e22", "#d35400", "#3498db", "#2980b9", "#e74c3c", "#c0392b", "#9b59b6",
"#8e44ad", "#bdc3c7", "#34495e", "#2c3e50", "#95a5a6", "#7f8c8d", "#ec87bf",
"#d870ad", "#f69785", "#9ba37e", "#b49255", "#b49255", "#a94136"]
size = @props.size

Ember.Console

This is a set of helpers for finding the application's currently active models/routes/controllers/etc. This isn't a straightforward process because of how Ember (rightly) encapsulates application objects, but it's useful in debugging environments to be able to quickly access them. And with the beta release of Ember Data, the store is not easily accessible without helpers either.

Usage

All helpers can be called directly if you provide them an application instance:

@pinyin
pinyin / ember_guides_combined
Created March 19, 2014 09:42
ember_guides_combined
# Guides and Tutorials
Welcome to the Ember.js guides! This documentation will take you from
total beginner to Ember expert. It is designed to start from the basics,
and slowly increase to more sophisticated concepts until you know
everything there is to know about building awesome web applications.
require "gimli"
require "yaml"
ROOT_PATH = "~/Documents/ember_guides/"
TABLE_OF_CONTENT_PATH = ROOT_PATH+"website/data/guides.yml"
GUIDE_FILES_PATH = ROOT_PATH+"website/source/guides/"
def concatenated_path
yaml_table_of_content = YAML.load_file TABLE_OF_CONTENT_PATH
concatenated_paths = []