Skip to content

Instantly share code, notes, and snippets.

# 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 / 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": {
[...$(".btn.btn-success.btn-xs")].map((button) => {
button.click();
})
@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}`;
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 / __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'
@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": {