The popular open-source contract for web designers and developers by Stuff & Nonsense
- Originally published: 23/12/2008
- Revised date: 15/12/2013
- Original post
// this happens when the view get's removed | |
if ($.MapWrapper != null) { // Alloy <View id="Wrapper">, wraps the map | |
$.MapWrapper.remove($.MapView); // the map <View ns="ns="Ti.Map" id="MapView"> | |
$.MapWrapper = $.MapView = null; | |
$.destroy(); | |
} |
// Detect autoplay | |
// --------------- | |
// This script detects whether the current browser supports the | |
// autoplay feature for HTML5 Audio elements, and it sets the | |
// `AUTOPLAY` variable accordingly. | |
// Used in the Meteor app [PicDinner](http://picdinner.com) |
gulp = require("gulp") | |
gulpUtil = require("gulp-util") | |
exec = require("child_process").exec | |
sys = require("sys") | |
gulpCoffee = require("gulp-coffee") | |
gulpConcat = require("gulp-concat") | |
gulpLess = require("gulp-less") | |
gulpLivereload = require("gulp-livereload") | |
gulpWatch = require('gulp-watch') |
0.008 secs: processImages | |
assetgraph-sprite: Canvas not found, skipping | |
0.000 secs: spriteBackgroundImages | |
events.js:72 | |
throw er; // Unhandled 'error' event | |
^ | |
Error: spawn ENOENT | |
at errnoException (child_process.js:988:11) | |
at Process.ChildProcess._handle.onexit (child_process.js:779:34) |
<div ng-include src="templateBasedOnWidth"></div> |
. | |
├── assets | |
│ ├── images | |
│ ├── sass/less/stylus/css | |
├── lib | |
│ ├── actions | |
│ ├── components | |
│ │ ├── __tests__ | |
│ │ │ └── Avatar.test.jsx | |
│ │ └── Avatar.jsx |
var EventSystem = (function() { | |
var self = this; | |
self.queue = {}; | |
var EventSystem = { | |
trigger: function (event, data) { | |
var queue = self.queue[event]; |
var nodes = document.querySelectorAll('*'); | |
var heights = _.filter(nodes, function(node) { | |
var height = parseFloat(node.style.height); | |
if ((height % 1) !== 0 && !isNaN(height)) { | |
return true; | |
} | |
return false; | |
}); |
function distance(obj) { | |
var R = 6371; // km | |
var dLat = (obj.lat2 - obj.lat1) * Math.PI / 180; | |
var dLon = (obj.lon2 - obj.lon1) * Math.PI / 180; | |
var lat1 = obj.lat1 * Math.PI / 180; | |
var lat2 = obj.lat2 * Math.PI / 180; | |
var a = Math.sin(dLat / 2) * Math.sin(dLat / 2) + | |
Math.sin(dLon / 2) * Math.sin(dLon / 2) * Math.cos(lat1) * Math.cos(lat2); | |
var c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a)); |