Skip to content

Instantly share code, notes, and snippets.

View Drowze's full-sized avatar

R Gibim Drowze

View GitHub Profile
@Drowze
Drowze / injections.scm
Created November 13, 2026 12:42
Jinja + neovim
; extends
; move this file to:
; after/queries/jinja/injections.scm
((content) @injection.content
(#inject-jinja-sublang!)
(#set! injection.combined))
@Drowze
Drowze / form.rb
Created November 11, 2026 20:01
Macro for defining a reform property that nullifies the property when the fragment is a literal empty string
def self.property_nullable_string(name, **options)
original_populator = options.delete(:populator)
property name, **options, populator: ->(fragment:, **rest) {
value = nil if fragment == ""
if original_populator
instance_exec(fragment: value, **rest, &original_populator)
else
public_send("#{name}=", value)
@Drowze
Drowze / openapi.yaml
Created October 1, 2026 13:19
Non-official openAPI spec for https://github.com/shortcuts/locationjoystick control API. This spec was AI generated based on the documentation available at https://locationjoystick.shrtcts.fr/control-api.html
openapi: 3.0.3
info:
title: locationjoystick Control API
version: "1.0"
description: |
Local HTTP API exposed by the locationjoystick Group Sync leader.
The API supports movement commands, route playback, roaming, spoofing,
favorites, routes, and speed profiles.
@Drowze
Drowze / main.rb
Created August 31, 2026 16:03
Headless CLI to look up and retrieve Motorola/Lenovo stock firmware download URLs via Lenovo's official firmware API, without requiring the official Lenovo Mobile Service Assistant (LMSA) Windows app. Heavily based on https://github.com/HikariCalyx/lmnflash
# frozen_string_literal: true
# Usage:
# - ruby main.rb # then follow the interactive prompts
#
# All credits to https://github.com/HikariCalyx/lmnflash
require "bundler/inline"
gemfile do
@Drowze
Drowze / parse_html_history.rb
Last active August 21, 2026 13:01
Parse MSN logs
# Parser for MSN plus logs
#
# Usage:
# $ ruby parse_html_history.rb "julho 2008.html" > output.md
require 'nokogiri'
class MsnLogParser
def initialize(file)
file = file.gsub(" ", " ") # replace non-breaking whitespaces for regular spaces
@Drowze
Drowze / undercover-extended
Created August 5, 2026 15:34
Extends undercover with a `rdjsonl` (for usage with `reviewdog`). Meant to be used as a replacement for `undercover`.
#!/usr/bin/env ruby
# frozen_string_literal: true
# Usage exact the same as `undercover`:
# $ chmod +x ./bin/undercover-extended
# $ ./bin/undercover-extended \
# --simplecov coverage/coverage.json \
# --compare origin/main \
# --format rdjsonl
@Drowze
Drowze / proxy_tester.rb
Last active March 17, 2026 17:57
Fetches proxies from multiple urls and test them using multiple threads. Results are saved across runs to avoid re-testing known proxies.
require 'net/http'
require 'uri'
require 'logger'
require 'parallel'
# Fetch proxies from multiple sources and test them against a specified URL, measuring response code and latency.
# Results are saved and reloaded on subsequent calls to avoid retesting recently tested proxies.
# Working proxies are saved in a separate text file with their response code and latency for easy reference.
class ProxyTester
# known exceptions that can be raised when testing a http proxy
@Drowze
Drowze / oh_auto_merge.fish
Last active January 31, 2026 04:33
Automatically approve & merge pull requests based on a GitHub search (which can be across repositories).
# Example:
# oh_auto_merge 'archived:False org:MyOrg is:pr state:open author:app/dependabot'
function oh_auto_merge --argument-names search_query
set -l graphql_query 'query SearchPullRequests($search_query: String!) {
viewer {
login
}
search(
query: $search_query
@Drowze
Drowze / config.ru
Last active December 17, 2025 21:07
Simple datadog trace parser/debugger
# frozen_string_literal: true
# Simple datadog trace parser/debugger
#
# To run, simply:
# $ rackup -p 8126
require 'roda'
require 'pry'
require 'msgpack'