Skip to content

Instantly share code, notes, and snippets.

View alexanderadam's full-sized avatar
⌨️
⌨️

Alexander Adam alexanderadam

⌨️
⌨️
View GitHub Profile
@alexanderadam
alexanderadam / vscode_file_watcher_analyser.rb
Created November 19, 2025 12:27
This helped me to optimize the file watcher usage of VSCode - this assumes running on Linux but I guess it can be modified / adapted for other OS - also see https://github.com/microsoft/vscode/issues/142763
#!/usr/bin/env ruby
require 'json'
class VSCodeAnalyzer
EXCLUDABLE = %w[node_modules vendor tmp build dist target .cache .crystal coverage log logs .next out .turbo]
HEAVY_DIR_THRESHOLD = { files: 100, percentage: 5.0 }
SEARCH_PATHS = %w[~/projects/%s ~/%s ./%s]
VSCODE_COMMANDS = %w[code-insiders code]
STORAGE_PATHS = [
@alexanderadam
alexanderadam / gist:6a9f669060d6420f550a8eb70d69fece
Created November 16, 2025 19:29
Per project shell history
# Per-project history
function _set_project_history() {
local project_id=""
# Check if we're in a git repository
if git rev-parse --git-dir > /dev/null 2>&1; then
# Try to get the remote URL (origin by default)
local remote_url=$(git config --get remote.origin.url 2>/dev/null)
if [ -n "$remote_url" ]; then
@alexanderadam
alexanderadam / linty.yml
Last active October 5, 2025 16:00
linty.yml
suppress_owl_ascii_art: true
use_colors: false
include_patterns:
- "spec/fixtures/examples/**"
exclude_patterns:
- ".git/**"
- "build/**"
- "container/**"
- "dist/**"
- "node_modules/**"
@alexanderadam
alexanderadam / each_with_index.rb
Created June 21, 2025 16:58
each_with_index vs each.with_index
#!/usr/bin/env ruby
require "benchmark/ips"
# ruby 3.3.6 (2024-11-05 revision 75015d4c1f) [x86_64-linux]
# Warming up --------------------------------------
# each.with_index 2.460k i/100ms
# each_with_index 3.613k i/100ms
# Calculating -------------------------------------
# each.with_index 26.436k (± 3.7%) i/s (37.83 μs/i) - 132.840k in 5.032459s
# each_with_index 37.158k (± 5.1%) i/s (26.91 μs/i) - 187.876k in 5.070741s
@alexanderadam
alexanderadam / dns_debug.rb
Created February 12, 2025 12:30
Simple Ruby script to check DNS visibility with `dig` on various DNS servers
#!/usr/bin/env ruby
require 'bundler/inline'
gemfile do
source 'https://rubygems.org'
gem 'resolv'
gem 'logger'
gem 'colorize'
gem 'optparse'
@alexanderadam
alexanderadam / s3_last_access_date.rb
Created February 12, 2025 09:59
Simple Ruby script to check when the data in an Exoscale S3 bucket was last modified
#!/usr/bin/env ruby
# frozen_string_literal: true
require 'bundler/inline'
gemfile do
source 'https://rubygems.org'
gem 'aws-sdk-s3', '~> 1.0'
gem 'terminal-table', '~> 3.0'
@alexanderadam
alexanderadam / mailserver_test.rb
Created January 28, 2025 15:34
Small script to check the health of a mailserver (IMAP and SMTP ports, SPF, etc)
#!/usr/bin/env ruby
# frozen_string_literal: true
require 'bundler/inline'
gemfile do
source 'https://rubygems.org'
gem 'net-smtp'
gem 'net-imap'
gem 'resolv'
@alexanderadam
alexanderadam / SCSS.md
Created March 6, 2022 19:46 — forked from jareware/SCSS.md
Advanced SCSS, or, 16 cool things you may not have known your stylesheets could do

⇐ back to the gist-blog at jrw.fi

Advanced SCSS

Or, 16 cool things you may not have known your stylesheets could do. I'd rather have kept it to a nice round number like 10, but they just kept coming. Sorry.

I've been using SCSS/SASS for most of my styling work since 2009, and I'm a huge fan of Compass (by the great @chriseppstein). It really helped many of us through the darkest cross-browser crap. Even though browsers are increasingly playing nice with CSS, another problem has become very topical: managing the complexity in stylesheets as our in-browser apps get larger and larger. SCSS is an indispensable tool for dealing with this.

This isn't an introduction to the language by a long shot; many things probably won't make sense unless you have some SCSS under your belt already. That said, if you're not yet comfy with the basics, check out the aweso

Draw Numbers Complementary #
1979-03-31 [2, 8, 17, 19, 21, 40] 1
1979-03-24 [3, 0, 5, 16, 35, 36] 37
1979-03-17 [0, 5, 6, 12, 19, 29] 39
1979-03-10 [12, 18, 2, 0, 25, 35] 38
1979-03-03 [3, 4, 11, 21, 27, 32] 37
1979-02-24 [5, 6, 14, 24, 34, 36] 26
1979-02-17 [5, 9, 17, 18, 20, 28] 29
1979-02-10 [6, 11, 18, 27, 32, 40] 13
1979-02-03 [6, 13, 23, 32, 36, 39] 9
@alexanderadam
alexanderadam / docker-on-android.md
Created October 23, 2020 14:59
Docker on Android

WORK IN PROGRESS

Docker on Android

Setup:

Samsung Galaxy Tab S5e SM-T720
Android Pie on Linux 4.9.112 (not rooted)
Termux