Skip to content

Instantly share code, notes, and snippets.

@kylebarrow
kylebarrow / example.html
Created June 23, 2011 06:30
Prevent links in standalone web apps opening Mobile Safari
<!DOCTYPE html>
<head>
<title>Stay Standalone</title>
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
<script src="stay_standalone.js" type="text/javascript"></script>
</head>
<body>
<ul>
<li><a href="http://google.com/">Remote Link (Google)</a></li>
@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})"
require "json"
require "rake-pipeline-web-filters"
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|
@coldnebo
coldnebo / Default (OSX).sublime-keymap -- User
Created February 3, 2012 16:21
Sublime Text 2 fix for OSX home/end keys
{ "keys": ["home"], "command": "move_to", "args": {"to": "bol"} },
{ "keys": ["end"], "command": "move_to", "args": {"to": "eol"} }
@moluapple
moluapple / Menu_Action_JS.jsx
Last active May 16, 2020 17:29
[Illustrator]Create, load and execute action all by JS only
// CS6 only
var set = 'Script Action', // 动作集名称
action = 'PastePDF', // 动作名称
menuEn = 'paste', // 菜单英文
menuZh = '粘贴', // 菜单中文
actionStr = ['/version 3',
'/name [ ' + set.length,
ascii2Hex(set),
']',

Routing in Ember

In Ember, the application's state manager handles routing. Let's take a look at a simple example:

App.stateManager = Ember.StateManager.create({
  start: Ember.State.extend({
    index: Ember.State.extend({
      route: "/",
@jasonm23
jasonm23 / xterm-256color.svg
Last active February 11, 2024 12:33
Xterm 256color mode color chart, organised into sections. (used on Wikipedia/xterm)
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@medigeek
medigeek / pyurl2file.py
Created July 25, 2012 16:03
Improve http://stackoverflow.com/a/22776/286994 (using .format() instead of % string formatting)
#!/usr/bin/python
# Improve http://stackoverflow.com/a/22776/286994
# (using .format() instead of % string formatting)
import sys
import urllib2
file_name = url.split('/')[-1]
u = urllib2.urlopen(url)
f = open(file_name, 'wb')
@agnoster
agnoster / README.md
Last active April 6, 2024 22:35
My ZSH Theme

agnoster.zsh-theme

A ZSH theme optimized for people who use:

  • Solarized
  • Git
  • Unicode-compatible fonts and terminals (I use iTerm2 + Menlo)

For Mac users, I highly recommend iTerm 2 + Solarized Dark

@dmzza
dmzza / bound_helper.js
Created September 26, 2012 16:50 — forked from ghempton/bound_helper.js
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: [],