Skip to content

Instantly share code, notes, and snippets.

@fzhem
fzhem / my-ublock-backup.txt
Last active November 9, 2024 13:13
uBlock Origin Backup
{
"timeStamp": 1731158018576,
"version": "1.60.0",
"userSettings": {
"advancedUserEnabled": true,
"externalLists": "https://cdn.jsdelivr.net/gh/hagezi/dns-blocklists@latest/adblock/light.txt\nhttps://cdn.jsdelivr.net/gh/hagezi/dns-blocklists@latest/adblock/spam-tlds-ublock.txt\nhttps://pup-filter.pages.dev/pup-filter.txt\nhttps://raw.githubusercontent.com/DandelionSprout/adfilt/master/Dandelion%20Sprout's%20Anti-Malware%20List.txt\nhttps://raw.githubusercontent.com/DandelionSprout/adfilt/master/LegitimateURLShortener.txt\nhttps://raw.githubusercontent.com/DandelionSprout/adfilt/refs/heads/master/BrowseWebsitesWithoutLoggingIn.txt\nhttps://raw.githubusercontent.com/Spam404/lists/master/adblock-list.txt\nhttps://raw.githubusercontent.com/fzhem/filter-annoyances/main/dist/specific.txt\nhttps://raw.githubusercontent.com/iam-py-test/my_filters_001/main/antimalware.txt\nhttps://raw.githubusercontent.com/quenhus/uBlock-Origin-dev-filter/main/dist/google/seo_spam.txt\nhttps://raw.githubusercontent.com/q
@fzhem
fzhem / keybindings.json
Last active November 25, 2024 11:57
VSCode Keyboard Shortcuts
// Place your key bindings in this file to override the defaults
[
{
"key": "ctrl+shift+l",
"command": "workbench.action.editor.changeLanguageMode",
"when": "!notebookEditorFocused"
},
{
"key": "ctrl+k m",
"command": "-workbench.action.editor.changeLanguageMode",
@fzhem
fzhem / settings.json
Last active September 11, 2024 10:02
VSCode Settings
{
"telemetry.telemetryLevel": "off",
"terminal.integrated.defaultProfile.windows": "Command Prompt",
"workbench.colorTheme": "Default Dark Modern",
"workbench.settings.editor": "json",
"workbench.settings.openDefaultSettings": true,
"workbench.settings.useSplitJSON": true,
"git.pruneOnFetch": true,
"editor.acceptSuggestionOnEnter": "off",
"editor.fontFamily": "'Fira Code', Consolas, 'Courier New', monospace",
@fzhem
fzhem / .pre-commit-config.yaml
Last active September 24, 2024 19:52
Custom pre-commit for all projects
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
exclude: |
(?x)(
^.gitignore|
^mypy.ini|
[mypy]
disallow_untyped_defs = True
disallow_any_unimported = True
disallow_subclassing_any = False
no_implicit_optional = True
check_untyped_defs = True
warn_return_any = True
warn_unused_configs = True
show_error_codes = True
warn_unused_ignores = True
@fzhem
fzhem / test_nullsafe.py
Created April 29, 2024 11:19
Test for nullsafe.py
import pandas as pd
import pytest
import numpy as np
from nullsafe import NullSafeSeriesAccessor
# Test cases for NullSafeSeriesAccessor
class TestNullSafeSeriesAccessor:
@pytest.fixture
def sample_data(self):
@fzhem
fzhem / nullsafe.py
Last active September 30, 2025 13:47
Null-safe comparison accessor for Pandas
import pandas as pd
@pd.api.extensions.register_series_accessor("nullsafe")
class NullSafeSeriesAccessor:
"""
Null-safe comparison accessor for Pandas Series.
This is equivalent to a null-safe equal operator in SQL (<=>) where
@fzhem
fzhem / Redirector.json
Created August 6, 2023 16:56
Totaljobs Email to direct non-tracking link
{
"createdBy": "Redirector v3.5.3",
"createdAt": "2023-08-06T16:55:13.699Z",
"redirects": [
{
"description": "Totaljobs Email to Link",
"exampleUrl": "https://www.totaljobs.com/JobSearch/EmailLink.aspx?JobID=100917216&GUID=",
"exampleResult": "https://www.totaljobs.com/job/100917216",
"error": null,
"includePattern": "(www\\.totaljobs\\.com).*JobID=(\\d+)",
@fzhem
fzhem / widget_get_argument.sql
Created July 26, 2023 08:23
Databricks workaround for using getArgument in SQL when scala UDFs are blocked on SQL. Limitation: Returns a string value so wouldn't work on FROM clause.
CREATE OR REPLACE TEMPORARY FUNCTION get_argument(widget STRING)
RETURNS STRING
COMMENT 'Get databricks widget value in SQL code. Throws an error if widget doesn\'t exist or empty value is provided. This is an alternative to `getArgument` scala UDF and should be used when scala UDFs are blocked on SQL.'
RETURN if(length(widget) > 0, widget, raise_error('Widget not found or empty value provided.'))
@fzhem
fzhem / wl-export-csv.bat
Last active August 20, 2025 20:46
yt-dlp command to export watch later playlist (replace brave with your browser) as a CSV file.
yt-dlp --cookies-from-browser brave --flat-playlist --output-na-placeholder "" --print-to-file %(title)#S,%(url)q,%(channel)#S,%(channel_url)q,%(duration)d,%(duration_string)q,%(view_count)d export-user-wl.csv https://www.youtube.com/playlist?list=WL