Skip to content

Instantly share code, notes, and snippets.

View rogerpedros's full-sized avatar
馃彔
Working from home

Roger Pedr贸s rogerpedros

馃彔
Working from home
View GitHub Profile
@rogerpedros
rogerpedros / gist:ab16c70e60d9b4ffad1e7229df0a4c7a
Created December 29, 2025 00:50
Privacy Policy for Flash Tab Saver
Privacy Policy for Flash Tab Saver
Flash Tab Saver respects your privacy. We do not collect, store, share, or sell any user data.
Data Collection: The extension does NOT collect any personal information, browsing history, or usage data.
Data Storage: All data (saved tabs, sessions, and preferences) is stored locally on your device using Chrome's Local Storage or your Bookmarks bar (if selected).
Third Parties: No data is sent to external servers or third parties.
Your data stays 100% on your machine.
@rogerpedros
rogerpedros / trackpad-mouse-scrolling-detection.js
Created March 16, 2020 14:58
Trackpad or mouse detection when scrolling.
//CODE FORM https://stackoverflow.com/a/56948026 created by Lauri.
//Detection quite accurate, but with errors at times.
//This errors can cause an uncontrolated DOM Node generation when scrolling, or in another environment false positives to other parts of the sistem.
//BUT in overall it maintains an stable 0,7 - 3% of CPU consumption when scrolling.
//For a code with a better accurate detection, BUT with a little more consumption of CPU: https://gist.github.com/Pedroos46/037494eff05359911dc5cdefa1c333dd
//CODE:
function handler(e) {
@rogerpedros
rogerpedros / trackpad-mouse-scrolling-detection.js
Last active March 16, 2020 15:52
Trackpad or mouse detection when scrolling
/*Copyright (c) 2020. Roger Pedr贸s Villorbina. Licensed under the Apache License, Version 2.0. */
//Detection accurate, without errors.
//Stable 1 - 4% of CPU consumption when scrolling.
let posX = 0, posY = 0, lastXvalues = [null, null, null], lastYvalues = [null, null, null];
document.onwheel = (e) => {
posX -= e.deltaX;
lastXvalues.shift();
@rogerpedros
rogerpedros / dictonary.sml
Created November 12, 2019 12:39
Dictonary implementation in sml
signature DICTIONARY =
sig
type 'a d
val empty: 'a d
val put: string -> 'a -> 'a d -> 'a d
val get: string -> 'a d -> 'a option
val remove: string ->'a d -> 'a d
val hasItem: string -> 'a d -> bool
end
@rogerpedros
rogerpedros / greater.sml
Created October 23, 2019 23:21
SML fun learning
fun maxP([], greater) = greater
| maxP(xs, greater) = if hd xs > greater
then maxP(tl xs, greater*0 + hd xs)
else maxP(tl xs, greater)
val b = maxP([2,23,4,5], 0);
@rogerpedros
rogerpedros / uniquenessRateTest.js
Last active May 5, 2019 21:45
Simple uniqueness test function for Javascript
/*
Funci贸n para comprobar la unicidad que genera un algoritmo.
En este caso se usa la funci贸n generateId() de: https://gist.github.com/Pedroos46/4861d55971f965d9047539ca5725bd0a
This function checks the uniqueness generated by an algorithm.
In this case we use the function generateId () of: https://gist.github.com/Pedroos46/4861d55971f965d9047539ca5725bd0a
*/
function uniqueRateTest() {
@rogerpedros
rogerpedros / idGenerator.js
Created May 5, 2019 21:25
Randomly ID generator for Javascript
/*
El objetivo de esta funci贸n es:
1r. Proporcionar una cadena que sea 煤nica.
2n. Adaptatable en tama帽o.
3r. Suficientemente compleja como para que sea muy improbable generar una igual.
Para generar UUIDs (Universally Unique IDentifier): https://gist.github.com/Pedroos46/73eeb419a29abaeb937c9a7ac4c71b18
The purpose of this function is:
1st. Provide a chain that is unique.
@rogerpedros
rogerpedros / idGenerator-uuidv4.js
Created May 5, 2019 21:23
RFC4122 ID generator for Javascript.
/*El objetivo de esta funcion es:
1r. Proporcionar un id que sea 煤nico.
2n. Estandarizada segun RFC4122.
The purpose of this function is:
1st Provide a unique id.
2n. Standardized according to RFC4122.
Fuente/Font: https://stackoverflow.com/questions/105034/create-guid-uuid-in-javascript/105074#105074
RFC4122: https://www.ietf.org/rfc/rfc4122.txt