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
#!/bin/bash | |
# Script to install PostgreSQL and PostGIS on a fresh Amazon Linux instance | |
# Installing from source: | |
# - GEOS | |
# GEOS 3.10+ requires CMake 3+, not readily available on Amazon Linux 2. | |
GEOSVER=3.9.2 | |
GEOSURL=http://download.osgeo.org/geos/geos-${GEOSVER}.tar.bz2 | |
# - PROJ (GDAL requires 6+; 6.2.1 is the last to use SQLite 3.7; 6.2 had build issues, so 6.1.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 items = [{name:'a', rank:3},{name:'b', rank:2},{name:'d', rank:1},{name:'c', rank:4}]; | |
function getAverage(itemsArray){ | |
var total = 0 ; | |
itemsArray.map(function (item){ | |
total += item.rank ; | |
} ); | |
return total / itemsArray.length ; | |
} |
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 ModalDialog = Backbone.View.extend({ | |
templateId: "dialog", // this is template id | |
className: "modal fade", | |
attributes: {tabindex:"-1", role:"dialog", | |
"aria-labelledby":"myModalLabel", | |
"aria-hidden":"true"}, | |
initialize: function() { | |
this.render(); | |
//to change modal width | |
// this.$el.find(".modal-dialog").css("width","75%"); |
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 domReady = (function (){ | |
var arrDomReadyCallBacks = [] ; | |
function excuteDomReadyCallBacks(){ | |
for (var i=0; i < arrDomReadyCallBacks.length; i++) { | |
arrDomReadyCallBacks[i](); | |
} | |
arrDomReadyCallBacks = [] ; | |
} | |
return function (callback){ |