Skip to content

Instantly share code, notes, and snippets.

View kmiyashiro's full-sized avatar
🐻

Kelly Miyashiro kmiyashiro

🐻
View GitHub Profile
!!! 5
html
head
title= title
//
[if IE8] <!--> <html class="no-js" lang="en"> <!--<![endif]
body!= body
!!! 5
//if lt IE 7 html(class="no-js ie6 oldie", lang="en")
//if IE 7 html(class="no-js ie7 oldie", lang="en")
//if IE 8 html(class="no-js ie8 oldie", lang="en")
//if gt IE8 <!--> <html class="no-js" lang="en"> <!--<![endif]
head
title= title
@kmiyashiro
kmiyashiro / layout2.jade
Created August 11, 2011 18:50 — forked from monokrome/layout2.jade
HTML5 Boilerplate Conditional comments in Jade
!!! 5
//if lt IE 7
html(class="no-js ie6 oldie", lang="en")
//if IE 7
html(class="no-js ie7 oldie", lang="en")
//if IE 8
html(class="no-js ie8 oldie", lang="en")
// [if gt IE 8] <!
html(class="no-js", lang="en")
// <![endif]
@kmiyashiro
kmiyashiro / app.js
Created August 26, 2011 01:36
ender issues with backbone events
var PageView = Backbone.View.extend({
el: '#content',
template: _.template($('#page-template').html()),
events: {
'click #back' : 'back',
'click #forward' : 'forward',
'click #side' : 'side'
},
@kmiyashiro
kmiyashiro / gist:1495695
Created December 19, 2011 06:24
backbone simple
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<title>Page Title</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" type="text/javascript" charset="utf-8"></script>
<script src="http://documentcloud.github.com/underscore/underscore-min.js" type="text/javascript" charset="utf-8"></script>
<script src="http://documentcloud.github.com/backbone/backbone-min.js" type="text/javascript" charset="utf-8"></script>
</head>
({
appDir: "../js",
baseUrl: "./",
dir: "../js-deploy",
//Comment out the optimize line if you want
//the code minified by UglifyJS
optimize: "none",
paths: {
'app' : 'app',
@kmiyashiro
kmiyashiro / locations
Created January 16, 2012 07:05
test file
js
model
user.js
test
test.js
Error: Calling node's require("model/user") failed with error: Error: Cannot find module 'model/user'
@kmiyashiro
kmiyashiro / MyView.js
Created February 6, 2012 18:06
Auto re-use element?
checkExisting: function() {
var existing = $(this.id)[0];
if (existing) this.setElement(existing);
}}
@kmiyashiro
kmiyashiro / gist:2013589
Created March 10, 2012 22:17
Upsert nested array/objects possible?
I have a schema that looks like this:
band: {
albums: [
{ tweets: [
{ tweet }, { tweet }
] }
]
}
I want to add the band (doc) if it doesn't exist.
@kmiyashiro
kmiyashiro / grunt.js
Created March 12, 2012 21:16
mote grunt task
/*global config:true, task:true*/
config.init({
options: {
templates: {
namespace: "tmpl",
dir: 'templates'
}
},
pkg: '<json:package.json>',
test: {