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 data = { | |
"coinlist": { | |
"bitcoin_faucets": { | |
"faucet_name": "btc Faucet", | |
"minutes": "5", | |
"amount": "90", | |
"claim_link": "http://bitcoinsfaucets.com" | |
}, | |
"eth_faucets": { | |
"faucet_name": "eth Faucet", |
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
"partial": function( chunk, context, bodies, params ){ | |
var partial_context = {}; | |
/* optional : context fo server processed partial related data*/ | |
var p_context = context.get("partial"); | |
if(p_context || params) { | |
// add to the partial context | |
} | |
return bodies.block( chunk, dust.makeBase(partial_context)); | |
} |
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
Fetch a collection require an array: | |
{ | |
'wrapper' : [ | |
{ | |
id:0, | |
name: 'Little Model 0' | |
}, | |
{ | |
id:1, |
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
// © 2012-2013, [ Abstract Codify ] Abstractcodify.com All Rights Reserved. <div class='class' style="right: 10px;"> any more.. </div> a = parseInt($('.class').css('right')); // value "a" echo 10 |
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
ssh -C -N [email protected] -L 3307:127.0.0.1:3306 |
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 is great for when your application fits the mold it provides. But don't be afraid to go around it when it makes sense for your application. It's a very small library. Making repetitive and duplicate GET requests just to fit backbone's mold is probably prohibitively inefficient. Check out jQuery.getJSON or your favorite basic AJAX library, paired with some basic metaprogramming as following: | |
*/ | |
//Put your real collection constructors here. Just examples. | |
var collections = { | |
Languages: Backbone.Collection.extend(), | |
ProductTypes: Backbone.Collection.extend(), | |
Menus: Backbone.Collection.extend() | |
}; |
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
jQuery(function() { | |
// Create our namespace and related organizers | |
window.DartsLeague = {}; | |
DartsLeague.Models = {}; | |
DartsLeague.Collections = {}; | |
DartsLeague.Views = {}; | |
DartsLeague.TourneysApp = new Backbone.Marionette.Application({}); | |
/******************************************** |
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
<!-- | |
Wrote a blog post about how it all works: | |
http://andymcfee.com/2012/08/24/css3-flip-cards/ | |
--> | |
<div class="viewport"> | |
<div class="flip-card"> | |
<div class="card-front"> | |
Front! |
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 regex = /(<\w+[^<]*?)\s+([\w-]+)="([^"]+)">/; | |
while(xml.match(regex)) xml = xml.replace(regex, '<$2>$3</$2>$1>'); // For attributes | |
xml = xml.replace(/\s/g, ' '). // Finds all the white space converts to single space | |
replace(/< *\?[^>]*?\? *>/g, ''). //Finds the XML header and removes it | |
replace(/< *!--[^>]*?-- *>/g, ''). //Finds and removes all comments | |
replace(/< *(\/?) *(\w[\w-]+\b):(\w[\w-]+\b)/g, '<$1$2_$3'). | |
replace(/< *(\w[\w-]+\b)([^>]*?)\/ *>/g, '< $1$2>'). | |
replace(/(\w[\w-]+\b):(\w[\w-]+\b) *= *"([^>]*?)"/g, '$1_$2="$3"'). | |
replace(/< *(\w[\w-]+\b)((?: *\w[\w-]+ *= *" *[^"]*?")+ *)>( *[^< ]*?\b.*?)< *\/ *\1 *>/g, '< $1$2 value="$3">'). |
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 AmericasNextTopModel = Backbone.Models.extend({ | |
initialize: function(){ | |
this.set({ | |
clefs: new ClefCollection(this.get('clefs')), | |
accidentals: new AccidentalCollection(this.get('accidentals')), | |
notes: new NoteCollection(this.get('notes')), | |
rests: new RestCollection(this.get('rests')) | |
}); | |
} |
NewerOlder