Skip to content

Instantly share code, notes, and snippets.

View bersLucas's full-sized avatar
🔁
https://gitlab.com/bersLucas

Lucas Bersier bersLucas

🔁
https://gitlab.com/bersLucas
  • Southeast Pennsylvania
View GitHub Profile
@bersLucas
bersLucas / AngularJSFactoryTaker.user.js
Last active January 29, 2020 16:48
AngularJSFactoryTaker.user.js
// ==UserScript==
// @name Factory Taker
// @version 1
// @grant none
// @match *://*/*
// @namespace bersLucas/AngularJSFactoryTaker
// ==/UserScript==
window.onload = () => {
setTimeout(() => {
* {
color: orange !important;
}
@bersLucas
bersLucas / extensions.js
Created May 13, 2019 15:53
Ungoogled Chromium Extensions
/*
Source: https://ungoogled-software.github.io/ungoogled-chromium-wiki/faq#can-i-install-extensions-or-themes-from-the-chrome-webstore
Change the flag chrome://flags/#extension-mime-request-handling to Always prompt for install.
Then when using the CRX URL from the omnibox or the custom search engine, the browser will prompt for installation.
*/
// LastPass
https://clients2.google.com/service/update2/crx?response=redirect&acceptformat=crx2,crx3&prodversion=73.0&x=id%3Dhdokiejnpimakedhajhdlcegeplioahd%26installsource%3Dondemand%26uc
export default function liljs(elem, data = {}, methods = {}) {
}
@bersLucas
bersLucas / gzipFile.js
Created April 1, 2019 20:23
gzip a file with node.js
var pako = require('pako');
var fs = require('fs');
fs.readFile('INPUT_FILENAME', (err, data) => {
var compressedFile = pako.gzip(data);
fs.writeFile('OUTPUT_FILENAME', compressedFile, (err) => {
console.log('Unable to gzip file!');
});
});
@bersLucas
bersLucas / AoC2018.js
Last active December 3, 2018 15:07
Advent of Code 2018 Answers
//Please be nice to me
let day1 = (input) => {
return input.split('\n').reduce((acc, cur) => {
return parseInt(acc) + parseInt(cur)
}, 0);
}
let day2 = (input) => {
let lines = [];
@bersLucas
bersLucas / generate.js
Last active October 3, 2018 14:35
Generator
let W = 90,
H = 150,
a = [];
for (var x = 0; x <= W; x++) {
a[x] = [];
for (var y = 0; y <= H; y++) {
a[x][y] = 0
}
}
@bersLucas
bersLucas / RYM-AutoTracklist.user.js
Last active November 5, 2022 18:32
Tracklist Auto-fill for RateYourMusic.com
// ==UserScript==
// @name Tracklist Auto-fill for RateYourMusic.com
// @version 1.0.3
// @grant none
// @match https://rateyourmusic.com/releases/ac
// @match https://rateyourmusic.com/releases/ac?*
// @namespace bersLucas/RYM
// ==/UserScript==
const searchURL = (url, scraper) => {
@bersLucas
bersLucas / geo.js
Created August 1, 2017 15:35
Location geotracking
navigator.geolocation.getCurrentPosition(
//success
function(response){console.log(response)},
//fail
function(response){console.log(response)},
{enableHighAccuracy: false, maximumAge: 15000, timeout: 30000}
);
@bersLucas
bersLucas / randomBgAndText.js
Last active October 7, 2016 13:10
Generate a random background color and a text color that has a variable contrast in relation to the background
function randomBgAndText(contrast){
var r = Math.round(Math.random() * 255);
var g = Math.round(Math.random() * 255);
var b = Math.round(Math.random() * 255);
var rText = r + 127 * (contrast / 100);
var gText = g + 127 * (contrast / 100);
var bText = b + 127 * (contrast / 100);
if (rText > 255){