Skip to content

Instantly share code, notes, and snippets.

View dentarg's full-sized avatar
🌦️
=:D><!

Patrik Ragnarsson dentarg

🌦️
=:D><!
View GitHub Profile
@x-yuri
x-yuri / a. Rails < 4.2.5 and pg >= 12 don't mix well.md
Last active November 19, 2021 00:35
#rails #pg #client-min-messages
@lancethomps
lancethomps / close_notifications_applescript.js
Last active November 3, 2025 04:19
AppleScript to close all notifications on macOS Big Sur, Monterey, Ventura, Sonoma, and Sequoia
function run(input, parameters) {
const appNames = [];
const skipAppNames = [];
const verbose = true;
const scriptName = 'close_notifications_applescript';
const CLEAR_ALL_ACTION = 'Clear All';
const CLEAR_ALL_ACTION_TOP = 'Clear';
const CLOSE_ACTION = 'Close';
@Dids
Dids / Compile_Go_for_Apple_Silicon_M1.md
Last active January 7, 2025 03:19
Compile Go for Apple Silicon (M1)

NOTICE: This guide is no longer relevant, as a lot has changed over time and Go supports Apple Silicon natively just fine now!

Compile Go for Apple Silicon (M1)

Follow these short instructions on how to compile Go for Apple Silicon (M1). From here on out, we may simply refer to it as the "ARM device".

This entire process should only take about 5-10 minutes, but please read through everything carefully, in order to avoid any potential issues along the way.

Note that at the time of writing this, Go was not yet officially available for Apple's ARM.

@rsms
rsms / id.go
Last active October 27, 2020 19:33
Sortable efficient universally unique identifier in Go — PUBLISHED HERE: https://github.com/rsms/go-uuid
/* ISC License
Copyright (c) 2020, Rasmus Andersson <rsms.me>
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
#!/bin/sh
ADMIN_URL="$1";
ORIG="$2";
COPY="$3";
# Create the COPY queue.
curl "$ADMIN_URL/api/queues/%2F/$ORIG" \
| curl -X PUT "$ADMIN_URL/api/queues/%2F/$COPY" -d @-;
@gruber
gruber / tot.sh
Last active November 9, 2024 22:41 — forked from chockenberry/tot.sh
A shell script for Tot
#!/bin/bash
# Fork of CHOCK's original tot.sh to add support for dot "0" to target
# the first empty dot.
# https://gist.github.com/chockenberry/d33ef5b6e6da4a3e4aa9b07b093d3c23
#
# 2 Mar 2020
# + Incorporated suggestions from ShellCheck (https://www.shellcheck.net).
# Thanks to Ramsey Dow.
# + Changed call to `python` to `/usr/bin/python` to get Python 2, avoiding
@dentarg
dentarg / online-expand.txt
Last active February 20, 2020 14:59
ZFS mirror pool expand
vagrant-mysql% grep ada /var/run/dmesg.boot
ada0 at ata0 bus 0 scbus0 target 0 lun 0
ada0: <VBOX HARDDISK 1.0> ATA-6 device
ada0: Serial Number VB95af0d4a-496c8996
ada0: 33.300MB/s transfers (UDMA2, PIO 65536bytes)
ada0: 65536MB (134217728 512 byte sectors)
ada1 at ahcich0 bus 0 scbus2 target 0 lun 0
ada1: <VBOX HARDDISK 1.0> ATA-6 SATA 2.x device
ada1: Serial Number VB31616783-08bbc3fa
ada1: 300.000MB/s transfers (SATA 2.x, UDMA6, PIO 8192bytes)
@nakwa
nakwa / reverse-proxy-tunnel.md
Last active October 28, 2023 17:42
Reverse proxy server for local tunnel / with HTTPS forwarding

Reverse proxy as a local tunnel / with HTTPS forwarding

Using SSH forwarding, NGINX, LetsEncrypt & Docker (Ruby-on-rails & Puma as dev server in current setup)

Stack & config

Gemfile

ruby '2.6.5'
gem 'puma', '4.3.1'
@filipkis
filipkis / update-gems.yml
Last active February 8, 2020 17:07
GitHub Action Workflow for updating gems after dependabot push
name: Update Gems After Dependabot
on:
push:
branches:
- 'dependabot/bundler/**'
paths:
- 'Gemfile.lock'
jobs: