Skip to content

Instantly share code, notes, and snippets.

@itsnebulalol
itsnebulalol / nixos-oracle.md
Created March 6, 2024 22:33
Install NixOS on an Oracle Cloud VM

NixOS on an Oracle Cloud VM

This gist was made for my own reference, but feel free to follow along. You should use your own Nix flake.

Booting NixOS

Since NixOS is not an official image for use on Oracle Cloud VM's, and users have reported that uploading the NixOS image does not work, we will use kexec to boot the installer.

sudo -i
@schacon
schacon / better-git-branch.sh
Created January 13, 2024 18:41
Better Git Branch output
#!/bin/bash
# Colors
RED='\033[0;31m'
GREEN='\033[0;32m'
NO_COLOR='\033[0m'
BLUE='\033[0;34m'
YELLOW='\033[0;33m'
NO_COLOR='\033[0m'
@lukas-slezevicius
lukas-slezevicius / index.html
Created March 12, 2023 17:02
Sorting/Drag&Drop Demo Using AlpineJS + TailwindCSS
<div class="min-h-screen justify-center flex p-16 bg-blue-200">
<div>
<!-- This is a revised version. See the original clunky version here: https://codepen.io/KevinBatdorf/pen/ff805cf637420bcbb2caa9d199527247?editors=1010 -->
<p class="mb-10 text-center">Drag & drop or press the menu icon button <br>(or use your tab key)</p>
<div class="pt-6 pb-4 bg-indigo-500 rounded-lg shadow-xl max-w-sm">
<h1 id="agenda-title" class="text-white font-extrabold text-lg p-6 pt-0">What's the agenda for today?</h1>
<ul
@danirukun
danirukun / .iex.exs
Created January 31, 2023 16:44
My custom global IEx script file that is preloaded before each IEx session. Adds some convenience functions.
IO.puts("Using .iex.exs file loaded from #{__DIR__}/.iex.exs")
defmodule Util do
def atom_status do
limit = :erlang.system_info(:atom_limit)
count = :erlang.system_info(:atom_count)
IO.puts("Currently using #{count} / #{limit} atoms")
end
@danirukun
danirukun / whisper-transcribe.bash
Last active October 7, 2026 20:46
Transcribe (and translate) any VOD (e.g. from Youtube) using Whisper from OpenAI and embed subtitles!
#!/usr/bin/env bash
# Small shell script to more easily automatically download and transcribe live stream VODs.
# This uses YT-DLP, ffmpeg and the CPP version of Whisper: https://github.com/ggerganov/whisper.cpp
# Use `./transcribe-vod help` to print help info.
# MIT License
# Copyright (c) 2022 Daniils Petrovs
@jmatsushita
jmatsushita / README
Last active September 27, 2026 21:28
Setup nix, nix-darwin and home-manager from scratch on an M1 Macbook Pro
###
### [2023-06-19] UPDATE: Just tried to use my instructions again on a fresh install and it failed in a number of places.
###. Not sure if I'll update this gist (though I realise it seems to still have some traffic), but here's a list of
###. things to watch out for:
### - Check out the `nix-darwin` instructions, as they have changed.
### - There's a home manager gotcha https://github.com/nix-community/home-manager/issues/4026
###
# I found some good resources but they seem to do a bit too much (maybe from a time when there were more bugs).
# So here's a minimal Gist which worked for me as an install on a new M1 Pro.
@asmeurer
asmeurer / svg2pdf.bash
Last active January 18, 2025 22:53 — forked from s417-lama/svg2pdf.bash
Reliable way to convert an SVG file to a PDF file using headless Chrome
#!/bin/bash
#
# Convert an SVG file to a PDF file by using headless Chrome.
#
if [ $# -ne 2 ]; then
echo "Usage: ./svg2pdf.bash input.svg output.pdf" 1>&2
exit 1
fi
@21isenough
21isenough / .bashrc
Last active April 14, 2022 18:58
Broadcast raw hex transaction over blockstreams TOR API
For context: https://twitter.com/21isenough/status/1255182788686462983?s=20
TorThisTx() {
# Rename "TorThisTx() to whatever you want the command to be
# Broadcast raw hex transaction over blockstreams TOR API with curl
curl --socks5-hostname localhost:9050 -d $1 -X POST http://explorerzydxu5ecjrkwceayqybizmpjjznk5izmitf2modhcusuqlid.onion/api/tx
}
@gasolin
gasolin / gist:9300f5f9276b2df884c80da3e2c54ffc
Last active July 15, 2023 10:13
Install Android Simulator

Install Android SDK on macOS

Install homebrew https://brew.sh/

brew cask install adoptopenjdk8
brew cask install android-sdk