Skip to content

Instantly share code, notes, and snippets.

View gabrieldewes's full-sized avatar
🎯
Focusing

Gabriel Dewes gabrieldewes

🎯
Focusing
View GitHub Profile
@gabrieldewes
gabrieldewes / uuid.js
Last active February 3, 2017 17:06
Simple and fast generation of RFC4122 UUIDs in Browser
/* Simple and fast generation of RFC4122 UUIDS. */
(function(root, factory) {
'use strict';
root.uuid = factory();
})(window, function() {
var byteToHex = [];
for (var i=0; i<256; ++i) {
byteToHex[i] = (i + 0x100).toString(16).substr(1);
@gabrieldewes
gabrieldewes / Hashify.js
Last active February 9, 2017 19:13
Simple Java Script object hashing
/**
* @description Simple hashing for JS objects
* @author Gabriel Dewes at 9 nov, 2016
*/
Object.prototype.hashify = function(obj, len) {
obj = obj || this;
len = len || 2;
var i, j, r=[];
for (i=0; i<len; i++) {
r.push(i*268803292);
@gabrieldewes
gabrieldewes / BinaryTree.java
Created October 31, 2016 12:02
A Binary Tree implementation in Java (recursive with basic functions (insert, remove))
// javac BinaryTree.java
// java BinaryTree
/**
* Created by Dewes on 13/09/2016.
*/
public class BinaryTree {
// Nosso nó pai
private Node node;
@gabrieldewes
gabrieldewes / BinaryTree.js
Last active November 30, 2016 13:17
A Binary Search Tree implementation in JavaScript (iterative)
/**
* @description Implementação de uma árvore binária de busca em JavaScript.
* @author Gabriel Dewes at 13 oct, 2016
*/
/**
* @constructor
*/
function BinaryTree() {
/**