View backbone.cache.js
/*!
* backbone.cache.js v0.0.2
* Copyright 2012, Boaz Sender (@boazsender)
* Based on backbone.collectioncache.js by Tim Branyen (@tbranyen) (https://gist.github.com/gists/3532848/edit)
* backbone.cacher.js may be freely distributed under the MIT license.
*/
(function(window) {
// Dependencies
var Backbone = window.Backbone;
View sample-backbone.routefilter-router.js
/*
* This code does not actually work, it is for demonstration purposes
* of a router using https://github.com/boazsender/backbone.routefilter
*/
// Imagine this came from the server into a big app wide state object
// (likely a Backbone.Model if we were actually doing this for real).
var data = {
// Here are my app's pages (it's content heavy app)
"pages": [{
View mobilecheckbox.css
input[type=checkbox] {
outline: none;
width: 58px;
height: 23px;
font-size: 11px;
line-height: 2;
display: block;
font-weight: bold;
border-radius: 3px;
border: 1px solid #B9B9B9;
View grunt.js
/*global config:true, task:true*/
config.init({
pkg: '<json:package.json>',
meta: {
banner: '/*! <%= pkg.title || pkg.name %> - v<%= pkg.version %> - ' +
'<%= template.today("m/d/yyyy") %>\n' +
'<%= pkg.homepage ? "* " + pkg.homepage + "\n" : "" %>' +
'* Copyright (c) <%= template.today("yyyy") %> <%= pkg.author.name %>;' +
' Licensed <%= _.pluck(pkg.licenses, "type").join(", ") %> */'
},
View grunt-jquery-init-template-output.sh
Please answer the following:
[?] Project name (Awesome)
[?] Project title (Awesome)
[?] Description (The best jQuery plugin ever.)
[?] Version (0.1.0)
[?] Project git repository (git://github.com/boazsender/Awesome.git)
[?] Project homepage (https://github.com/boazsender/Awesome)
[?] Project issues tracker (https://github.com/boazsender/Awesome/issues)
[?] Licenses (MIT)
[?] Author name (Boaz Sender)
View index.html
<!DOCTYPE html>
<html>
<head>
<title>Twitter Search Plugin</title>
<script src="http://code.jquery.com/jquery.js"></script>
<script src="jquery.twitter.js"></script>
<style type="text/css">
body { padding: 10px; font-family: sans-serif; }
h2 { font-weight: normal; margin-top: 20px; clear: both; }
.twitter-posts li { margin-bottom: 10px; font-size: 12px; clear: both; list-style-type:none; }
View index.html
<!DOCTYPE html>
<html>
<head>
<title>Twitter Search Plugin</title>
<script src="http://code.jquery.com/jquery.js"></script>
<script src="https://github.com/boazsender/jQuery-Twitter-Plugin/blob/master/dist/jquery.twitter.js"></script>
<style type="text/css">
.twitter-posts li { margin-bottom: 10px; font-size: 12px; clear: both; list-style-type:none; }
.twitter-posts li img { float:left; width: 48px; margin:0px 10px 10px 0px;border:1px solid #c2c2c2; -moz-box-shadow: 0px 0px 4px #c2c2c2; -webkit-box-shadow: 0px 0px 4px #c2c2c2; box-shadow: 0px 0px 4px #c2c2c2; }
.twitter-posts li a { text-decoration:none; color: #009; }
View webserver.js
/*
This is a slightly tweaked version of
https://github.com/nhira/node-simple-webserver/blob/master/webserver.js
*/
var sys = require("sys"),
http = require("http"),
url = require("url"),
path = require("path"),
fs = require("fs");
View keyboard-event-trigger.js
/*
Chrome does not let you modify the keyCode prop when you trigger it, so it defaults to 0.
You can use this code to trigger a keydown with a char code of 0 in chrome.
If you use initKeyEvent instead of initKeyboardEvent, it will work in FF
(the bellow example would trigger keydown with a char code of 65 in FF).
*/
document.addEventListener( 'keydown', function( event ){
console.log( event.keyCode )
View abacus-api-notes.js
var mainLoop = Abacus.timer({
callback: function( data ) {
data.delta // time since the last tick
data.ticks // zero indexed number of ticks
}
});
// Start the timer with an optional kill time in miliseconds
// if no miliseconds are passed in, it wil run FOR EV AR, until you pause it
mainLoop.start( 10000 )