Skip to content

Instantly share code, notes, and snippets.

View drazulay's full-sized avatar
Ready to Rock

Daniel R. Azulay drazulay

Ready to Rock
View GitHub Profile
@drazulay
drazulay / protonmail-delete-spam-filter-domains.js
Last active April 11, 2025 16:31
Javascript to quickly delete all defined spam filers in protonmail settings in the web environment.
const getDomainKeys = () => Object.entries(Array.from(document.querySelectorAll('#spam tbody tr[role="row"]'))).flatMap(el => {
Object.entries(el[1]).find(v => v[0].startsWith('__reactFiber$'))[1].return.key);
};
const deleteDomainsByKeys = async (ids) => {
await fetch("https://account.proton.me/api/mail/v4/incomingdefaults/delete", {
"credentials": "include",
"headers": {
"User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:138.0) Gecko/20100101 Firefox/138.0",
"Accept": "application/vnd.protonmail.v1+json",
### Keybase proof
I hereby claim:
* I am drazulay on github.
* I am drazulay (https://keybase.io/drazulay) on keybase.
* I have a public key ASBd375erlSqCspFwRb32NVCQxaS5C2eBJ4daNRPunNtAwo
To claim this, I am signing this object:
@drazulay
drazulay / starship.toml
Last active November 5, 2024 20:15
My starship prompt config file
"$schema" = 'https://starship.rs/config-schema.json'
add_newline = false
scan_timeout = 10
format = '$all$line_break$username$hostname$directory$character'
[fill]
symbol = '-'
style = 'white'
[character]
@drazulay
drazulay / iterm2.json
Created November 5, 2024 18:53
My iterm2 profile as json
{
"Ansi 7 Color" : {
"Green Component" : 0.73333334922790527,
"Red Component" : 0.73333334922790527,
"Blue Component" : 0.73333334922790527
},
"Tags" : [
],
"Ansi 12 Color" : {
@drazulay
drazulay / .zshrc
Last active November 5, 2024 20:15
My .zshrc, mostly copied from grml.org's zshrc. It uses starship to generate the zsh prompt instead of grml's prompt generation stuff.
#################### FROM GRML.ORG ZSH CONFIG ####################
# zsh profiling
# just execute 'ZSH_PROFILE_RC=1 zsh' and run 'zprof' to get the details
if [[ $ZSH_PROFILE_RC -gt 0 ]] ; then
zmodload zsh/zprof
fi
typeset -A GRML_STATUS_FEATURES
@drazulay
drazulay / install.sh
Last active September 20, 2024 19:11
Quickly set up magento2 with redis, amqp and elasticsearch and link the domain in valet-plus.
#! /usr/bin/env bash
if [ ! -f app/etc/env.php ]; then
printf "Installing magento..\n"
php bin/magento setup:install \
--db-host 127.0.0.1 \
--db-name magento2 \
--db-user admin \
--db-password admin123 \
--search-engine elasticsearch7 \
@drazulay
drazulay / DarkModeToggle.js
Created April 9, 2024 05:17
Toggle between light and dark color modes with React
import React, { useEffect, useState } from "react";
import { useMediaQuery } from "react-responsive";
export const DarkModeToggle = () => {
const [isDark, setIsDark] = useState(true);
useMediaQuery(
{
query: "(prefers-color-scheme: dark)",
},
@drazulay
drazulay / killphp.sh
Created April 4, 2024 17:53
Kill all PHP-FPM instances running
killphp () {
printf "This will kill all PHP-FPM instances running. Continue (y/N)? "
read -q
if [[ $? -eq 0 ]]
then
for pid in $(ps aux | grep php-fpm | grep -v color | tr -s " " | cut -d" " -f2)
do
sudo kill -9 $pid
done
echo "\nall instances killed"
@drazulay
drazulay / wekker
Last active September 7, 2023 08:43
A terminal alias implementing an alarm clock.
# Usage: wekker 21:04 /path/to/audiofile.mp3.
# Add this to your ~/.profile or wherever you store your aliases.
# You could run it from crontab.
alias wekker='_wekker(){ printf "you will be woken up at %s with audio file %s\n" "$1" "$2"; while [ 1 ]; do; date "+%H:%M" | grep -q "$1"; [[ $? -eq 0 ]] && open -a VLC "$2" && break || sleep 1; done; }; _wekker'
@drazulay
drazulay / install.sh
Last active April 2, 2022 08:59
OS X Developer onboarding script
#! /usr/bin/env bash
################################
# Onboarding script for OS X
# Installs a bunch of software,
# and optionally an extra bunch
# of other software - yay, more
# bytezz! Also does some config-
# foo like a small zsh and os x
# polish.