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
import _ from 'underscore'; | |
let toNumbers = function(arr) { | |
return _.map(arr, _.partial(parseInt, _, 10)); | |
} | |
let execFuncs = function(arr) { | |
return _.map(arr, function(item) { | |
return _.isFunction(item) ? item() : item; | |
}) |
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
{ | |
"center":{ | |
"lat":56.16, | |
"lng":10.18 | |
}, | |
"zoom":"12", | |
"filters":"1", | |
"wp":{ | |
"markers":[ | |
{ |
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 _ = require( 'underscore' ); | |
// Gulp + gulp tools | |
var gulp = require('gulp'); | |
var $ = require( 'gulp-load-plugins' )(); | |
var livereload = require('gulp-livereload'); | |
var opn = require ('opn'); | |
// Webpack | |
var webpack = require("webpack"); |
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 _ = require('underscore'); | |
var AutoSaveMixin = { | |
componentWillMount: function() { | |
this.queueAutoSave = _.debounce( this.queueAutoSave, 1800 ) | |
}, | |
saveData: function() { | |
this.setState({ loading: true }, function() { | |
this.props.model.save().always(() => { | |
this.setState({loading: false}); |
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
/* | |
Takes something like domain.com/?param1=one¶m2=two and converts it into something like | |
{ param1: 'one', param2: 'two' } | |
*/ | |
var query = {}; | |
if ( location.search ) { | |
var pieces, param, i, len; | |
var chunks = location.search.slice(1).split("&"); | |
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
$ease-in-sine: cubic-bezier( 0.47, 0, 0.745, 0.715 ); | |
$ease-out-sine: cubic-bezier( 0.39, 0.575, 0.565, 1 ); | |
$ease-in-out-sine: cubic-bezier( 0.445, 0.05, 0.55, 0.95 ); | |
$ease-in-quad: cubic-bezier( 0.55, 0.085, 0.68, 0.53 ); | |
$ease-out-quad: cubic-bezier( 0.25, 0.46, 0.45, 0.94 ); | |
$ease-in-out-quad: cubic-bezier( 0.455, 0.03, 0.515, 0.955 ); | |
$ease-in-cubic: cubic-bezier( 0.55, 0.055, 0.675, 0.19 ); | |
$ease-out-cubic: cubic-bezier( 0.215, 0.61, 0.355, 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
var SearchRouter = Backbone.Router.extend({ | |
routes: { | |
"search/:query": "search", | |
"": "root" | |
}, | |
root: function() { | |
this.trigger( "reset" ); | |
}, | |
search: function(query) { | |
this.trigger( "search", decodeURIComponent( query ) ); |
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
@media (min-width: 480px) and (max-width: 767px) { | |
// Do something | |
} | |
@media (min-width: 768px) { | |
// Do something else | |
} |
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 ["underscore", "backbone", "gsap"], (_, Backbone) -> | |
# The clockwork tells the rest of the system, when it's time to move | |
# tasks from scheduled to active. | |
# | |
# Internally, the timer uses TweenLite from GreenSock. This might seem a little strange, but | |
# TweenLite, unlike a good old setTimeout, can tell you how long is left in the current timer clock | |
# and it is more predictable. A setTimeout for 10 seconds is not 10 seconds in reality, but 10 seconds + | |
# any script execution time during those 10 seconds — Thus making the timer unpredictable after | |
# the app has been open for a longer period of time. |
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 ["underscore", "gsap"], (_) -> | |
class ParallaxFun | |
constructor: -> | |
@center = { x: window.innerWidth >> 1, y: window.innnerHeight >> 1 } | |
@updated = no | |
$(document).on( "mousemove", @updateMousePos ); | |
setTimeout( @doParallax, 1000 ) | |
updateMousePos: (e) => | |
@center.x = e.clientX |