Skip to content

Instantly share code, notes, and snippets.

View jaronwanderley's full-sized avatar

Jaron Wanderley jaronwanderley

View GitHub Profile
@jh3y
jh3y / magnify-this.js
Last active July 20, 2024 18:15
Magnify This. Bookmarklet code for magnifying a website.
javascript:(function () {
var active;
var magnifier;
var config = {
scale: 75,
size: 160,
image:
'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQAAAAEACAYAAABccqhmAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAOtMSURBVHgBrL2JmuS4zQQYyK/e/42b2EkRcUDVY/vf3bKnK0spkSCOwMFDdep0F9D9z3/8jfjvfe379/nnn8/8ffqfazXfNY7a+V77XsXz/fk2gn9+8+o//3yb+efSP9fm7+jj+89zb+G2Md9/H2A/35/nmtqfNqfvnr+zv2Yb/9x/YpykjW3c5jyuZzxFOmYMddvxdQQN7/H85fr7+3m+a9N3ya+hA+r7PG1eWmroJy+f+5//7ee+f3+fAeV0QgY1fOiQpfofum9nz7OHn3vz6bY/8v/S+X2W8unh29CdfFMfKY/gbS/5//MF9eBLy/eGD/XYcmGf5PXhtTN8Hxm7r9Ad9pn2Eboj+SPtZNp7Pv/zz+efcZwWzzrsY/X5Hcsaw9D7JbggmtIeT8hC16RD2LpyIJ6fe+n5/WP1ug8UB3a16FGs5pejI50KNMTRqJ4nxuKevz/Tfl0lGF1/nqsYxHQ7mvXPr88/9zbBokJF2ko49J1/tLhG4fkbYRjdVOPnMvzXvf/5xDYevRrg4p2PUpzhHHlgnpAy0TAGUexsjKLMaff7vX42P9hvVQ1wmGgaVdOcef3Lqw9u3xLkUEY6SXNodX1GBqAy9+0XIbfRmOJjyLF/CT+3WdLesAH2lVd9an7jkZdQ76UHNbI+//yvKq+HBoweSZ/68orGGMwaJ1OPo/oa42DT0+B95ozkpt1nvE1lhMVMhQs7CF0cxbnjnRs+dXXz80+/f1IGo4hz+9MV++4BSOp5fVq8fcBhQ
@julienetie
julienetie / detect-browser.js
Last active April 5, 2024 12:47
Detect the operating system (os), browser and browser version without relying on depreciated ways.
const navigatorErrorMessage = 'Could not find `userAgent` or `userAgentData` window.navigator properties to set `os`, `browser` and `version`'
const removeExcessMozillaAndVersion = /^mozilla\/\d\.\d\W/
const browserPattern = /(\w+)\/(\d+\.\d+(?:\.\d+)?(?:\.\d+)?)/g
const engineAndVersionPattern = /^(ver|cri|gec)/
const userAgentData = window.navigator.userAgentData
const userAgent = window.navigator.userAgent
const unknown = 'Unknown'
const empty = ''
const brandList = ['chrome', 'opera', 'safari', 'edge', 'firefox']
@brgaulin
brgaulin / Readme.md
Last active April 19, 2024 10:03
ESP32-S2 Keyboard on Arduino
@appy-one
appy-one / db.js
Created December 18, 2020 16:37
Using AceBase instead of Dexie.js to store sticky notes in the browser's IndexedDB. See Andy Haskell's IndexedDB tutorial Part 4 at https://dev.to/andyhaskell/using-dexie-js-to-write-slick-indexeddb-code-304o
let { AceBase } = require('acebase');
// Database contains all IndexedDB database logic for our web app.
class Database {
// The constructor opens/creates the database titled 'my_db_(namespace)'
constructor(namespace) {
// Use AceBase.WithIndexedDB to create an AceBase instance
// that uses IndexedDB to store its data
let name = Database.dbName(namespace);
@erictroebs
erictroebs / Touch.cpp
Last active November 10, 2023 17:14
Arduino Micro (ATmega32U4) Ten Finger Touchscreen Example
#include "Touch.h"
#if defined(_USING_HID)
#define CONTACT_COUNT_MAXIMUM 10
#define REPORTID_TOUCH 0x04
#define LSB(v) ((v >> 8) & 0xff)
#define MSB(v) (v & 0xff)
@thednp
thednp / flatten.js
Created August 17, 2020 09:10 — forked from timo22345/flatten.js
Flatten.js, general SVG flattener. Flattens transformations of SVG shapes and paths. All shapes and path commands are supported.
<!doctype html>
<html>
<title>Flatten.js, General SVG Flattener</title>
<head>
<script>
/*
Random path and shape generator, flattener test base: https://jsfiddle.net/fjm9423q/embedded/result/
Basic usage example: https://jsfiddle.net/nrjvmqur/embedded/result/
@fanoush
fanoush / DK08.js
Last active May 27, 2021 07:49
DK08 demo
function KickWd(){
if(!BTN1.read())E.kickWatchdog();
}
var wdint=setInterval(KickWd,5000); // 5 secs
E.enableWatchdog(20, false); // 20 secs
E.kickWatchdog();
/*
// MIT License (c) 2020 fanoush https://github.com/fanoush
// see full license text at https://choosealicense.com/licenses/mit/
var SPI2 = E.compiledC(`
@jniac
jniac / html.js
Last active November 18, 2022 09:25
html generator based on template literals
// https://gist.github.com/jniac/1f1b8e57dbb320138af00680c090f94e
const parser = new DOMParser()
const html = (strings, ...inserts) => {
if (typeof strings === 'string') {
// html is used as a regular function, eg:
// html(`<div>${foo}</div>`)
@fanoush
fanoush / P8-SPILCD-demo.js
Last active September 22, 2021 12:33
Inline C P8 LCD DMA demo
E.kickWatchdog();
function KickWd(){
if( (typeof(BTN1)=='undefined')||(!BTN1.read()) ) E.kickWatchdog();
}
var wdint=setInterval(KickWd,2000);
E.enableWatchdog(15, false);
/*
// MIT License (c) 2020 fanoush https://github.com/fanoush
// see full license text at https://choosealicense.com/licenses/mit/
var SPI2 = E.compiledC(`
@prb28
prb28 / mathcalc.js
Last active April 15, 2021 00:15 — forked from paiv/mathcalc.js
Expression parser in JavaScript
//
// MathCalc: a parser for basic mathematical expressions
// From here: https://paiv.github.io/blog/2016/03/23/js-calc.html
//
//
// Copyright (c) 2016, Pavel Ivashkov, github.com/paiv
//
// Permission to use, copy, modify, and/or distribute this software for any
// purpose with or without fee is hereby granted, provided that the above
// copyright notice and this permission notice appear in all copies.