Skip to content

Instantly share code, notes, and snippets.

View lelesrc's full-sized avatar

lele lelesrc

  • Youleaf
  • Rome, Italy
View GitHub Profile
@sdesalas
sdesalas / Async.gs
Last active May 9, 2024 07:02
Asynchronous execution for Google App Scripts (gas)
/*
* Async.gs
*
* Manages asyncronous execution via time-based triggers.
*
* Note that execution normally takes 30-60s due to scheduling of the trigger.
*
* @see https://developers.google.com/apps-script/reference/script/clock-trigger-builder.html
*/
@dai-shi
dai-shi / benchmark-simpleregex.js
Last active December 14, 2015 23:59
benchmark regex.test, string.match, and string.search
var Benchmark = require('benchmark');
Benchmark.prototype.setup = function() {
s = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxtestyyyyyyyyyyyyyyyyyyyyy';
re = new RegExp('te[xs]t');
};
var suite = new Benchmark.Suite();
// add tests
suite.add('regex test', function() {
var r1 = re.test(s);