Skip to content

Instantly share code, notes, and snippets.

View anteriovieira's full-sized avatar
🏠
Working from home

Antério Vieira anteriovieira

🏠
Working from home
View GitHub Profile
@anteriovieira
anteriovieira / profile.js
Created November 28, 2017 22:18 — forked from ericelliott/profile.js
A good enough profile script to compare two versions of a fibonacci generator.
import iterativefib from 'iterativefib';
import memofib from 'memofib';
import range from 'test/helpers/range';
const nsTime = (hrtime) => hrtime[0] * 1e9 + hrtime[1];
const profile = () => {
const numbers = 79;
const msg = `Profile with ${ numbers } numbers`;
var subscribers = []
var activeJob = null
var a = 3
var state = {
get a () {
if(subscribers.indexOf(activeJob) < 0){
subscribers.push(activeJob)
}
return a
@ericelliott
ericelliott / profile.js
Last active November 28, 2017 22:18
A good enough profile script to compare two versions of a fibonacci generator.
import iterativefib from 'iterativefib';
import memofib from 'memofib';
import range from 'test/helpers/range';
const nsTime = (hrtime) => hrtime[0] * 1e9 + hrtime[1];
const profile = () => {
const numbers = 79;
const msg = `Profile with ${ numbers } numbers`;
@themsaid
themsaid / HasEnums.php
Last active August 29, 2020 23:23
PHP Enumerated Type
trait HasEnums
{
/**
* The array of enumerators of a given group.
*
* @param null|string $group
* @return array
*/
static function enums($group = null)
{