Skip to content

Instantly share code, notes, and snippets.

View jaygooby's full-sized avatar
✏️
working on https://writiny.com in my sparse spare time

Jay Caines-Gooby jaygooby

✏️
working on https://writiny.com in my sparse spare time
View GitHub Profile
fn marine_line() -> String {
use rand::{seq::SliceRandom, Rng};
let marine_life = ["🐳", "🐠", "🦈", "🐙", "🐡", "🐬", "🐟", "🦀", "🐋"];
let water = [
"\x1B[38;2;0;100;200m≈\x1B[0m",
"\x1B[38;2;10;110;210m≈\x1B[0m",
"\x1B[38;2;20;120;220m≈\x1B[0m",
"\x1B[38;2;30;130;230m≈\x1B[0m",
"\x1B[38;2;40;140;240m≈\x1B[0m",
@thomaswilburn
thomaswilburn / pigeon.js
Last active May 7, 2024 15:19
Convert CSS to nested CSS
import { parse } from "https://deno.land/x/[email protected]/mod.ts";
var file = Deno.args[0];
var input = await Deno.readTextFile(file);
var parsed = parse(input, { value: true });
var root = {
rules: [],
@ryancdotorg
ryancdotorg / wzip.py
Last active October 22, 2024 14:42
Partial/streaming zip downloader
#!/usr/bin/env python3
# SPDX-License-Identifier: 0BSD or CC0-1.0 or MIT-0 or Unlicense
# Copyright (c) 2023, Ryan Castellucci, No Rights Reserved
import io, sys
import datetime
import argparse
import requests
import operator
import struct
@xdesro
xdesro / killport.sh
Last active March 2, 2023 19:01
Kill processes at a given port.
function killport {
echo '🚨 Killing all processes at port' $1
lsof -ti tcp:$1 | xargs kill
}
@ieatfood
ieatfood / Connect Airpods.applescript
Last active November 13, 2024 16:40 — forked from jaredmoody/Connect Airpods.applescript
An Applescript to connect bluetooth devices, such as Airpods. Nice when paired with an alfred trigger.
# Taken from https://www.reddit.com/r/MacOS/comments/i4czgu/big_sur_airpods_script/gck3gz3/
# by https://github.com/smithumble
use framework "IOBluetooth"
use scripting additions
set AirPodsName to "AirPods"
on getFirstMatchingDevice(deviceName)
repeat with device in (current application's IOBluetoothDevice's pairedDevices() as list)
#!/bin/bash
# http://redsymbol.net/articles/unofficial-bash-strict-mode/
set -euo pipefail
IFS=$'\n\t'
# inspired by
# https://gist.github.com/codeinthehole/26b37efa67041e1307db
# https://github.com/why-jay/osx-init/blob/master/install.sh
# https://github.com/timsutton/osx-vm-templates/blob/master/scripts/xcode-cli-tools.sh
@nomeddie
nomeddie / smtpd.conf
Created November 27, 2020 23:27
opensmtpd 6.6.4p1 simple relay config for aws ses
# v20201127
#
# If you edit the files, you have to run "smtpctl update table <aliases|secrets>"
table aliases file:/etc/aliases
table secrets file:/etc/secrets
# To accept external mail, replace with: listen on all
#
listen on localhost
@IanColdwater
IanColdwater / twittermute.txt
Last active October 13, 2024 04:40
Here are some terms to mute on Twitter to clean your timeline up a bit.
Mute these words in your settings here: https://twitter.com/settings/muted_keywords
ActivityTweet
generic_activity_highlights
generic_activity_momentsbreaking
RankedOrganicTweet
suggest_activity
suggest_activity_feed
suggest_activity_highlights
suggest_activity_tweet
@sbliven
sbliven / google-authenticator.rb
Last active March 16, 2024 09:31 — forked from Dan-Q/google-authenticator.rb
Command-line Google Authenticator (TOTP)
#!/usr/bin/env ruby
# frozen_string_literal: true
# encoding: utf-8
#
# TOTP implementation (google authenticator)
#
# Reads ~/.google-authenticator-accounts for account info.
# For security, you should run `chmod 600 ~/.google-authenticator-accounts
#
# Changelog:
@arthurattwell
arthurattwell / split.sh
Last active November 24, 2021 11:52
Split a markdown file into separate files on YAML frontmatter
#!/bin/bash
# That tells Linux to use a Bourne shell interpreter.
# Run this script from the current directory. (Required on OSX.)
cd -- "$(dirname "$0")"
# Don't echo these commands.
set +v
# Get the filename from the user.