Skip to content

Instantly share code, notes, and snippets.

View masasron's full-sized avatar

Ron Masas masasron

View GitHub Profile
class minHeap {
constructor() {
this.items = [];
}
peek() {
return this.items[0];
}
@masasron
masasron / gwf.js
Last active April 6, 2017 11:35
Check your website position on Google.
'use strict'
class WebsiteFinder {
constructor(url){
this.currentPage = 1
this.resultPlace = null
this.hostname = this.getHostName(url)
this.timer = setInterval( () => {
@masasron
masasron / 1.md
Last active March 26, 2017 06:23

Event Manager Class

var EventsManagerClass = function() {

    /**
     * Store events callback and context.
     *
/**
* Basic Pagination Object for Firebase array reference
*
* @param {Firebase} firebase_reference
* @param {integer} limit
*/
function Pagination(firebase_reference,limit) {
var page = 0; // Current page
var caching = {}; // Caching db
var last_key = false; // Last object key pointer
@masasron
masasron / test.js
Last active September 8, 2015 07:02
var Test = function(){
this.pools;
this.init = function() {
this.pools = [
{id: 1,percent: 0.40,use: 0,index: 0,db: []},
{id: 2,percent: 0.30,use: 0,index: 1,db: []},
@masasron
masasron / PatternsRecognizer.js
Last active August 29, 2015 14:23
A simple patterns recognition algorithm
var PatternsRecognizer = function() {
this.p = {v: '',c: 0};
this.findAll = function(data) {
this.p = {v: '',c: 0};
var patterns = [];
var stop = false;
while(!stop){