Skip to content

Instantly share code, notes, and snippets.

View DATADEER's full-sized avatar
💭
Be useful on the internet

Lucca Sanwald DATADEER

💭
Be useful on the internet
View GitHub Profile
@DATADEER
DATADEER / chromedriver-nightwatchjs-config.json
Created June 27, 2017 14:40
How to set ChromeDriver language (locale) in Nightwatchjs config. Line 35 - 38
{
"src_folders": [
"tests"
],
"output_folder": "./reports",
"custom_commands_path": "",
"custom_assertions_path": "",
"page_objects_path": "",
"globals_path" : "nightwatch.globals.js",
"selenium": {
@DATADEER
DATADEER / __resource.lua
Created July 9, 2017 18:29
[FiveM Server] Get random loadout on respawn (REQUIRE LOADOUTS DOES NOT WORK)
client_script 'loadouts.lua'
client_script 'preconditions.lua'
const win = new electron.BrowserWindow(...)
// When work makes progress, show the progress bar
function onProgress (progress) {
// Use values 0 to 1, or -1 to hide the progress bar
win.setProgressBar(progress || -1) // Progress bar works on all platforms
}
// When work completes while the app is in the background, show a badge
var numDoneInBackground = 0
@DATADEER
DATADEER / googleAnalyticsOptOutCookie.js
Last active May 24, 2018 10:51
[ES6] GDRP|EPRIVACY - GOOGLE ANALYTICS OPT-OUT COOKIE POPUP
/*
.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.
Detects if optOut cookie has been set.
Disables google analytics network communication
gaOptOut() sets neccessary cookie
.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.
*/
const googleAnalyticsUserID = XX-XXXXXXXXX-X; // Enter your GoogleAnalyticsID
const disablerString = `ga-disable-${googleAnalyticsUserID}`;
[...$(".btn.btn-success.btn-xs")].map((button) => {
button.click();
})
@DATADEER
DATADEER / arrows_mod.json
Last active August 7, 2022 20:09
Map FN + E,S,D,F TO ARROW_UP,ARROW_LEFT,ARROW_DOWN,ARROW_RIGHT in Karabiner Elements
{
"title": "ARROWS",
"rules": [
{
"description": "LEFT_ARROW",
"manipulators": [
{
"type": "basic",
"from": {
"modifiers": {
# parses and sums up durations of each episode from the designacademy.io course
# paste into console on https://www.designacademy.io/lesson/welcome-to-the-course/
Array.from(document.querySelectorAll('.note'))
.map((elem) => elem.innerText)
.map((text) => text.split('|')[1])
.filter((exists)=>exists)
.map((text)=> text.trim().split(':')
.map((number) => parseInt(number))
.reduce((acc,curr,i)=>i===0 ? acc + (curr * 60): acc + curr ,0))
@DATADEER
DATADEER / lock_pdf.sh
Last active November 24, 2020 12:52
Locks a pdf with a custom (owner) password via pdftk. ONLY LOCKS EDITING.
#!/bin/sh
# Locks a pdf with a custom password via pdftk.
# ONLY LOCKS EDITING. CAN STILL BE OPENEND WITHOUT PASSWORD
# HOW TO:
# pdftk has to be globally accessible. https://www.pdflabs.com/
# run sh lock.sh [filename_without_filetype] [password]
filename=$1
password=$2
echo locking "$filename".pdf &&
{
"%%true": {
"%function": {
"name": "canReadWritePartition",
"arguments": [
"%%partition"
]
}
}
}