Skip to content

Instantly share code, notes, and snippets.

name: Renovate
on:
schedule:
# The "*" (#42, asterisk) character has special semantics in YAML, so this
# string has to be quoted.
- cron: '0/15 * * * *'
jobs:
renovate:
@kepler-5
kepler-5 / comp_multi.rs
Last active August 13, 2026 11:04
Python comprehension proc macro that handles multiple nested for-if-clauses, flattening nested structure
// This is free and unencumbered software released into the public domain.
// Anyone is free to copy, modify, publish, use, compile, sell, or
// distribute this software, either in source code form or as a compiled
// binary, for any purpose, commercial or non-commercial, and by any
// means.
// In jurisdictions that recognize copyright laws, the author or authors
// of this software dedicate any and all copyright interest in the
// software to the public domain. We make this dedication for the benefit
@alephao
alephao / html-to-elementary.js
Created September 26, 2024 13:32
Convert raw html into swift/elementary
// Update this value w/ the HTML you want to convert
const htmlToConvert = `<div>Hello World</div>`
// Below is the conversion script
const indentation = " "
const _voidElements = new Set([
'area',
'base',
'br',
@ptoffy
ptoffy / XCTAssert(Not)Nil
Last active June 20, 2025 09:45
Swift Testing Migration Utilities
replace: XCTAssertNil\((.*)\)
with: #expect($1 == nil)
replace: XCTAssertNotNil\((.*)\)
with: #expect($1 != nil)
@rubdos
rubdos / scalingd.service
Created January 18, 2024 22:25
sway automatic scaling on dock (for my Framework)
[Unit]
Description=Sway scaling daemon
[Service]
Environment=HOME=/home/rsmet/
ExecStart=/usr/bin/python /home/rsmet/.local/bin/sway-scaling-daemon.py
Restart=always
ExecStartPost=/bin/sleep 1
[Install]
@gabydd
gabydd / config.toml
Last active March 1, 2025 18:06
helix lf
[keys.normal]
C-f = [":new", ":insert-output lf-pick", "split_selection_on_newline", "goto_file", "goto_last_modification", "goto_last_modified_file", ":buffer-close!", ":theme nord", ":theme default"]
# replace the default after theme with the theme you use
# open 1 with the open command (l and <left> to open) or more with (<space> to select) then quit
# all opened files will be opened in helix
@benbacardi
benbacardi / gist:227f924ec1d9bedd242b
Last active June 2, 2025 14:41
Django reverse with a querystring
from django.utils.http import urlencode
def reverse_querystring(view, urlconf=None, args=None, kwargs=None, current_app=None, query_kwargs=None):
'''Custom reverse to handle query strings.
Usage:
reverse('app.views.my_view', kwargs={'pk': 123}, query_kwargs={'search': 'Bob'})
'''
base_url = reverse(view, urlconf=urlconf, args=args, kwargs=kwargs, current_app=current_app)
if query_kwargs:
return '{}?{}'.format(base_url, urlencode(query_kwargs))
@javierarilos
javierarilos / micro-mongodb-python-book.py
Created May 22, 2014 21:47
The Little MongoDB Book code examples written in Python + pymongo
##########################################################################
# THE MICRO MONGODB+PYTHON BOOK
#
# A simple adaptation to Python + summary of
# The Little MongoDB Book: https://github.com/karlseguin/the-little-mongodb-book
#
# javier arias losada
# twitter: @javier_arilos
# Usage suggestion: run line by line bu using pydemo project (https://github.com/pablito56/pydemo)
@aras-p
aras-p / preprocessor_fun.h
Last active August 15, 2026 15:30
Things to commit just before leaving your job
// Just before switching jobs:
// Add one of these.
// Preferably into the same commit where you do a large merge.
//
// This started as a tweet with a joke of "C++ pro-tip: #define private public",
// and then it quickly escalated into more and more evil suggestions.
// I've tried to capture interesting suggestions here.
//
// Contributors: @r2d2rigo, @joeldevahl, @msinilo, @_Humus_,
// @YuriyODonnell, @rygorous, @cmuratori, @mike_acton, @grumpygiant,