- Organize resources into sections
- More detailed sections (perhaps sections & subsections)
This file contains 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 input = "@ch: THIS IS A BOOK @c:professional-quality display and classified ads using a web interface. You can control the quality of these ads — and accept them later in the production cycle — while still giving your customers a wide range of creative options. At the same time, the process provides an opportunity to cross-sell and upsell your customers to higher value placements by showing them additional options during the creation process. You can even add new categories of advertisements without expending additional resources."; | |
var r = /(@.*?:)/g; | |
var k = r.exec( input ); |
This file contains 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 Collection View | |
* | |
* A light-weight approach to display filetered data from collection by assigning rules, without changing original models, | |
* which works just like CollectionView in other languages (ie: Java, WPF and AS3). | |
* | |
* Usage: | |
* | |
* 1. Filter by single field: | |
* this.wineList.filterView( {Country:'France'}} ); |
This file contains 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 = function(grunt) { | |
grunt.loadNpmTasks('grunt-requirejs'); | |
grunt.initConfig({ | |
requirejs: { | |
std: { | |
options: { | |
almond: true, | |
baseUrl: "lib", |
This file contains 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 fsm = StateMachine.create({ | |
initial: 'hungry', | |
events: [ | |
{ name: 'eat', from: 'hungry', to: 'satisfied', action: 'foo' }, | |
{ name: 'eat', from: 'satisfied', to: 'full', action: 'bar' }, | |
{ name: 'eat', from: 'full', to: 'sick', action: 'coo' }, | |
{ name: 'rest', from: ['hungry', 'satisfied', 'full', 'sick'], to: 'hungry', action: 'doo' }, | |
]}); |
This file contains 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 (window) { | |
var StateMachine = { | |
//--------------------------------------------------------------------------- | |
VERSION: "2.2.0", | |
//--------------------------------------------------------------------------- |
This file contains 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
/** | |
* @param useRGB Boolean, true for rgba format, false will return color in hex format | |
* @param randomAlpha Boolean, when using rgba format, decide whether to randomnize alpha value too | |
*/ | |
function getRandomColor( useRGB, randomAlpha ){ | |
if( useRGB ){ | |
return "rgba("+ | |
Math.floor(Math.random()*256)+","+ | |
Math.floor(Math.random()*256)+","+ | |
Math.floor(Math.random()*256)+","+ |
This file contains 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
I tried to pause the script, then enter following command in the console: | |
document.getElementById('foo') | |
The weird part is, sometimes it will show the object state, but some times it will just show the <div> tag, seems it's the result of toString() ? | |
Is there a way to always get object state in the console ? | |
Screen cap here: http://cl.ly/image/0V1a1p3t0e12 |
This file contains 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
/* | |
RequireJS 2.1.4 Copyright (c) 2010-2012, The Dojo Foundation All Rights Reserved. | |
Available via the MIT or new BSD license. | |
see: http://github.com/jrburke/requirejs for details | |
*/ | |
/*! jQuery v1.9.1 | (c) 2005, 2012 jQuery Foundation, Inc. | jquery.org/license | |
//@ sourceMappingURL=jquery.min.map | |
*/ |
This file contains 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
$.extend({ | |
getQueryString: function ( urlString, key) { | |
function parseParams() { | |
var params = {}, | |
e, | |
a = /\+/g, // Regex for replacing addition symbol with a space | |
r = /([^&=]+)=?([^&]*)/g, | |
d = function (s) { return decodeURIComponent(s.replace(a, " ")); }, | |
q = urlString; |
OlderNewer