Built with blockbuilder.org
This file contains hidden or 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
### | |
### This gist contains 2 files : settings.json and lambda_function.py | |
### | |
### settings.json | |
{ | |
"extensions" : ["*.hdr", "*.glb", "*.wasm"] | |
} | |
### lambda_function.py |
This file contains hidden or 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 requestApi() { | |
return $q.when(); | |
} | |
var wrapApi = lastPromise(requestApi) | |
.then(function() { | |
// we are done here | |
}); | |
function lastPromise(fn) { |
This file contains hidden or 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 randomProb(hash, n){ | |
var bucketHash = {}, bucketHash, index, key, | |
sum=0, results =[], randValue, curBucketValue; | |
for(key in hash){ | |
sum += hash[key]; | |
bucketHash[key] = sum; | |
} | |
for (var index = 0; index < n; index++) { | |
randValue = Math.random(); |
This file contains hidden or 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 ids = [1,2,3]; | |
var aggregateIds = function(ids, obj, callback){ | |
var id; | |
if(!obj){ | |
obj = {}; | |
} | |
if(ids.length){ | |
setTimeout(function(){ | |
var id = ids.shift(); |
This file contains hidden or 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
# | |
#Todo: | |
#1. read args for source and destination directories | |
#2. read all folder in source directory | |
#3. read all package.json and get repo url | |
#4. for each url execute git clone | |
# | |
fs = require('fs') | |
{exec} = require('child_process') |
This file contains hidden or 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 _bindArrayMethod(name, obj) { | |
obj.prototype[name] = function () { | |
return Array.prototype[name].apply(this, arguments); | |
}; | |
} | |
function subClassArray(obj) { | |
var index; | |
for (index = 0; index < methods.length; index++) { | |
_bindArrayMethod(methods[index], obj); |
This file contains hidden or 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
<html ng-app="Test" > | |
<head> | |
<title>Field splitter directive - Demo page</title> | |
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js" ></script> | |
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.2.5/angular.min.js"></script> | |
<script type="text/javascript" src="angular-field-splitter.js" ></script> | |
<script type="text/javascript"> | |
angular.module('Test', ['fieldSplitter']); |
This file contains hidden or 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
array = [1,4,5,6,10,13] | |
class BinarySearch | |
constructor:(@elems)-> | |
@len = @elems.length | |
midPoint = (start, end)-> | |
((end - start)/2) + start | |
find : (value, start=0, end =-1)-> |
This file contains hidden or 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
exports.trace = function(label) { | |
// TODO probably can to do this better with V8's debug object once that is | |
// exposed. | |
var err = new Error; | |
err.name = 'Trace'; | |
err.message = label || ''; | |
Error.captureStackTrace(err, arguments.callee); | |
console.error(err.stack); | |
}; |
NewerOlder