- node.js
- Installation paths: use one of these techniques to install node and npm without having to sudo.
- Node.js HOWTO: Install Node+NPM as user (not root) under Unix OSes
- Felix's Node.js Guide
- Creating a REST API using Node.js, Express, and MongoDB
- Node Cellar Sample Application with Backbone.js, Twitter Bootstrap, Node.js, Express, and MongoDB
- JavaScript Event Loop
- Node.js for PHP programmers
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
if ('serviceWorker' in navigator) { | |
navigator.serviceWorker.register('/service-worker.js'); | |
} | |
const CACHE_PREFIX = 'Client'; | |
const CACHE_VERSION = 'v1'; | |
const CACHE_NAME = `${ CACHE_PREFIX }-${ CACHE_VERSION }`; | |
const CACHE_URLS = [ | |
'/dist/offline.html', | |
'/dist/vendors.js', |
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
app.filter('daterange', function() { | |
return function(items, startDate, endDate) { | |
var filteredResult = []; | |
// Parse from the filter format 'dd/mm/yyyy' (Turkish culture) | |
function parseDateFromFilter(strDate) { | |
var parts = strDate.split('/'); | |
return new Date(parts[2], parts[1] - 1, parts[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
define([ | |
'marionette', | |
'handlebars', | |
'modules/accountsData/views/pie', | |
'modules/accountsData/views/table', | |
'text!modules/accountsData/templates/wrapper.html', | |
], | |
function(Marionette, Handlebars, pie, table, tmpl) { |
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
/*jshint browser:true */ | |
/*global jQuery */ | |
/* | |
jquery.scrollpane-startstop.js | |
Custom start and stop scrolling events for jScrollPane | |
https://gist.github.com/1963544 | |
Usage: |
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
/** | |
* localStorage with expire wrapper | |
*/ | |
var myStorage = (function() { | |
var self = {}; | |
/** | |
* Method unsets value in localStorage | |
*/ | |
self.unset = function(key) { |
#A simple Slideshow module wrapped in a Backbone View
- Dependencies ** underscore.js ** backbone.js
Viewable in action in this jsfiddle
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
// browser history with HTML5 support | |
(function() { | |
var loc = window.location, | |
pushSupport = !!(window.history && window.history.pushState), | |
hashStrip = /^#*/; | |
// add HTML5 support to Backbone.history, drop the old IE stuff | |
_.extend(Backbone.History.prototype, { | |
getFragment : function(l) { |
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
# | |
# Replaces Backbone.History with support for HTML5 history API if browser supports it. | |
# To use, setup your controllers as usual and try it with a browser that supports the HTML5 history API. | |
# For browsers that don't support the HTML5 API, this will fall back to using the default Backbone hash routing. | |
# | |
# I have only tested this on my project in Firefox, Safari and Chrome so let me know. | |
# | |
pushSupport = window.history? and window.history.pushState? | |
if pushSupport and Backbone? and Backbone.History? | |
rootUrl = document.location.protocol+'//'+(document.location.host or document.location.hostname) |