Skip to content

Instantly share code, notes, and snippets.

View Desttro's full-sized avatar

Desttro

  • Czech Republic
View GitHub Profile
@Desttro
Desttro / multiprocess_selenium.py
Created February 15, 2021 11:10 — forked from wooddar/multiprocess_selenium.py
Easy Python script to run selenium web workers/browsers in parallel
"""
This is an adaptable example script for using selenium across multiple webbrowsers simultaneously. This makes use of
two queues - one to store idle webworkers and another to store data to pass to any idle webworkers in a selenium function
"""
from multiprocessing import Queue, cpu_count
from threading import Thread
from selenium import webdriver
from time import sleep
from numpy.random import randint

Disable Device Enrollment Program (DEP) notification on macOS Catalina.md

With full reinstall (recommended)

   a. Boot into recovery using command-R during reboot, wipe the harddrive using Disk Utility, and select reinstall macOS

   b. Initial installation will run for approximately 1 hour, and reboot once

   c. It will then show a remaining time of about 10-15 minutes

@Desttro
Desttro / axis-headers.js
Created August 6, 2021 09:00 — forked from paltman/axis-headers.js
override axios default csrf header and cookie name to match what Django expects
var axios = require("axios");
var axiosDefaults = require("axios/lib/defaults");
axiosDefaults.xsrfCookieName = "csrftoken"
axiosDefaults.xsrfHeaderName = "X-CSRFToken"
@Desttro
Desttro / Protonmail.md
Created October 30, 2021 12:07 — forked from githubcom13/Protonmail.md
Configure the protonmail bridge linux client on Ubuntu 20.04 and Debian 10 server

Protonmail on Ubuntu 20.04 and Debian 10 server

#protonmail #debian #linux

Before you start

Currently protonmail bridge for linux is distributed as part of an open beta program, but soon it will be made public (https://protonmail.com/bridge/install).

Consider that the bridge linux client requires a paid protonmail account to work.

Get the protonmail bridge linux installer

@Desttro
Desttro / try-finally-yield.py
Created March 17, 2022 06:14 — forked from TFlexSoom/try-finally-yield.py
Try Finally Testing With Asynchronous and Synchronous Generators
import time
import logging
import asyncio
def get_generator():
try:
yield "hello there!"
finally:
logging.info("Finally Block Has Been Run!")
@Desttro
Desttro / README.md
Created April 5, 2022 19:23 — forked from 0x77dev/README.md
mercurius-js/mercurius #370
import { codes } from './database';
const app = document.querySelector('.app') as HTMLDivElement;
const videoEl = app.querySelector('video');
const canvasEl = app.querySelector('canvas');
const labelsEl = app.querySelector('.labels') as HTMLDivElement;
const ctx = canvasEl.getContext('2d');
interface Window {
BarcodeDetector: any;
@Desttro
Desttro / iterm2-solarized.md
Created August 7, 2022 11:13 — forked from kevin-smets/iterm2-solarized.md
iTerm2 + Oh My Zsh + Solarized color scheme + Source Code Pro Powerline + Font Awesome + [Powerlevel10k] - (macOS)

Default

Default

Powerlevel10k

Powerlevel10k

@Desttro
Desttro / README.md
Created October 5, 2022 15:12 — forked from babldev/README.md
NextJS Background Task

NextJS Background Task Example

An example of how to add a background task (e.g. a queue consumer) to an existing NextJS project.

Setup

  • Add your background task file
  • Add a new worker-tsconfig.json, specifically specifying "module": "commonjs" and targeting only the worker source files.
  • Add convenience functions for building & running to package.json

Then to build once:

@Desttro
Desttro / ci-pnpm-install.md
Created July 16, 2023 02:11 — forked from belgattitude/ci-pnpm-install.md
Composite github action to improve CI time with pnpm

Why

Although @setup/node as a built-in cache option, it lacks an opportunity regarding cache persistence. Depending on usage, the action below might give you faster installs and potentially reduce carbon emissions (♻️🌳❤️).

Requirements

pnpm v7 or v8 (not using pnpm ? see the corresponding yarn action gist)

Bench