Skip to content

Instantly share code, notes, and snippets.

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

Adilson Fuxe AdilsonFuxe

🏠
Working from home
View GitHub Profile
@solenoid
solenoid / gist:1372386
Created November 17, 2011 04:49
javascript ObjectId generator
var mongoObjectId = function () {
var timestamp = (new Date().getTime() / 1000 | 0).toString(16);
return timestamp + 'xxxxxxxxxxxxxxxx'.replace(/[x]/g, function() {
return (Math.random() * 16 | 0).toString(16);
}).toLowerCase();
};
@AdilsonFuxe
AdilsonFuxe / linked-list.js
Created September 26, 2022 14:42
Linked List with javascript
var ListNode = function (val, next) {
this.val = val === undefined ? 0 : val;
this.next = !next ? null : next;
};
var MyLinkedList = function () {
this.head = null;
};
/**