This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module.exports = (grunt) -> | |
| grunt.loadNpmTasks 'grunt-contrib-watch' | |
| grunt.loadNpmTasks 'grunt-contrib-concat' | |
| grunt.initConfig | |
| pkg: grunt.file.readJSON 'package.json' | |
| watch: | |
| options: | |
| livereload: true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var App = { | |
| Views: {}, | |
| Models: {}, | |
| Collections: {} | |
| }; | |
| App.Models.Item = Backbone.Model.extend({ | |
| defaults: function() { | |
| return { | |
| viewtype: '', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta http-equiv="content-type" content="text/html; charset=UTF-8"> | |
| <title></title> | |
| <script type='text/javascript' src='http://code.jquery.com/jquery-git2.js'></script> | |
| <style type='text/css'> | |
| .selected { | |
| background: #f00; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| on work_folder(the_path) | |
| tell application "Finder" | |
| set the_files to every file of the_path | |
| repeat with afile in the_files | |
| peel_label(afile) of me | |
| end repeat | |
| set the_folders to every folder of the_path | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| to joinList(aList, delimiter) | |
| set retVal to "" | |
| set prevDelimiter to AppleScript's text item delimiters | |
| set AppleScript's text item delimiters to delimiter | |
| set retVal to aList as string | |
| set AppleScript's text item delimiters to prevDelimiter | |
| return retVal | |
| end joinList | |
| on run {input, parameters} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (function() { | |
| var map = {}; | |
| var elems = document.querySelectorAll('h1, h2, h3, h4, h5, h6, h7, p, li, dt, dd'); | |
| var cid; | |
| var text; | |
| for (var i = 0, iz = elems.length; i < iz; i++) { | |
| cid = 'c' + i; | |
| elems[i].setAttribute('contenteditable', 'true'); | |
| elems[i].setAttribute('data-cid', cid); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $(document).on('keydown', function(event) { | |
| if ((event.which == 115 || event.which == 83) && (event.ctrlKey || event.metaKey) || (event.which == 19)) { | |
| event.preventDefault(); | |
| // do something | |
| return false; | |
| } | |
| return true; | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Backbone.Shape = {}; | |
| Backbone.Shape.Rect = Backbone.View.extend({ | |
| className: 'shape rect', | |
| isClosed: false, | |
| paper: null, | |
| shape: null, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| body { | |
| background: #ccc; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $(function () { | |
| var $win = $(window); | |
| var $doc = $(document); | |
| var $body = $('body'); | |
| var winWidth = $win.width(); | |
| var winHeight = $win.height(); | |
| var $vertical = $('<div/>').css({ | |
| position: 'absolute', | |
| top: 0, | |
| left: winWidth * 0.5, |