View this code at http://livecoding.io/3449453
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
Location = { | |
referencia: { | |
type: Number, | |
unique: true | |
}, | |
owner: { | |
type: Schema.Types.ObjectId, | |
ref: 'Owner' | |
}, | |
accounts: [ |
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
Object.prototype.ext = function(obj){ | |
for(var prop in obj){ | |
if(!Object.prototype[prop]){ | |
this[prop] = obj[prop] | |
} | |
} | |
} | |
var x = {a: 1, b: 2, c: 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
//READER Directive | |
var initNotes = function($scope, Note, element, $compile){ | |
Note.find({ | |
user: $scope.global.user._id, | |
module: $scope.module._id | |
}).then(function(response) { | |
$scope.notes = response; | |
angular.forEach($scope.notes, function(note){ | |
var highlighted = element.find('span.phrase:contains("'+note.selectedText+'")'); | |
var html = '<oowli-note _id="'+note._id+'" content="'+note.content+'"></oowli-note>'; |
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
fs.readFile(file.path, function(err, buff){ | |
completed++; | |
if(err){ return; } | |
var headers = { | |
'Content-Length': buff.length, | |
'Content-Type': 'text/plain' | |
}; | |
var push = client.put(file.name, headers); | |
push.on('response', function(res){ |
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 Busboy = require('busboy'); //A streaming parser for HTML form data: https://github.com/mscdex/busboy | |
var generateId = require('time-uuid'); | |
//** Handler to recive file uploads via stream | |
module.exports.boUpload = { | |
method: 'POST', | |
path: '/upload/', | |
config:{ | |
payload: 'stream' | |
}, | |
handler: function (request) { |
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
(function setupGoogleMaps(){ | |
if(typeof google === 'undefined'){ return; } | |
//Instantiate map object and set core options | |
var map = new google.maps.Map(document.getElementById("map"), { | |
center: new google.maps.LatLng(52.37022, 4.89517), | |
zoom: 6, | |
disableDefaultUI: true | |
}); | |
//Instaniate infoWindow and marker image objects |
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
FIRST TIME | |
JS-Calendar | |
git subtree split -P libs/bundles/albumprinter -b ap-transition | |
online-editor | |
git init | |
do one commit first | |
git remote add calendar ../js-calendar/ | |
git subtree add --prefix=src calendar ap-transition |
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 | |
echo "Running Post-Receive hook" | |
while read oldrev newrev ref ; do | |
if [ "$ref" == "refs/heads/master" ]; then | |
GIT_WORK_TREE=/home/josh/production/sonimcampaign git checkout -f | |
echo 'branch master deployed to live' | |
elif [ "$ref" == "refs/heads/staging" ]; then | |
git symbolic-ref HEAD refs/heads/staging | |
GIT_WORK_TREE=/home/josh/staging/sonimcampaign git checkout -f | |
git symbolic-ref HEAD refs/heads/master |
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 Dog = function(name, age){ | |
if(!name || !age){ | |
throw new Error('not enough params'); | |
} | |
this.name = name; | |
this.age = age; | |
} |
OlderNewer