Skip to content

Instantly share code, notes, and snippets.

View frankV's full-sized avatar
🦑
Work Hard. Cuttlesoft.

Frank Valcarcel frankV

🦑
Work Hard. Cuttlesoft.
View GitHub Profile

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
@frankV
frankV / GrossPelicanLoop.html
Created June 18, 2014 23:57
PelicanArticleLoopHack
<section class="wrapper style1 container special">
<div class="row">
<h2 class="space-above">Latest Posts</h2>
</div>
<div class="row">
{% for article in all_articles %}
{% if loop.index < 4 %}
<div class="4u">
<section>
<script>
document.addEventListener("DOMContentLoaded", function() {
//Get the contents
var source = document.querySelector("#results-template").innerHTML;
//Compile them into a template
template = Handlebars.compile(source);
// add the formatName helper
/*global Todos Ember */
'use strict';
Todos.EditTodoView = Ember.TextField.extend({
classNames: ['edit'],
valueBinding: 'todo.title',
change: function () {
var value = this.get('value');
/*global Todos DS Ember */
'use strict';
Todos.Todo = DS.Model.extend({
title: DS.attr('string'),
isCompleted: DS.attr('boolean'),
todoDidChange: function () {
Ember.run.once(this, function () {
this.get('store').commit();
/*global Todos Ember */
'use strict';
Todos.Router.map(function () {
this.resource('todos', { path: '/' }, function () {
this.route('active');
this.route('completed');
});
});
/*global Ember */
window.Todos = Ember.Application.create();
<script type="text/x-handlebars" data-template-name="todos">
<section id="todoapp">
<header id="header">
<h1>todos</h1>
{{view Ember.TextField id="new-todo" placeholder="What needs to be done?"
valueBinding="newTitle" action="createTodo"}}
</header>
{{#if length}}
<section id="main">
<ul id="todo-list">
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Ember Starter Kit</title>
<link rel="stylesheet" href="css/normalize.css">
<link rel="stylesheet" href="css/style.css">
</head>
<body>
// create an Ember App instance
App = Ember.Application.create();
App.Router.map(function() {
// put your routes here
});
// return an elemtary model as a list
App.IndexRoute = Ember.Route.extend({
model: function() {