Skip to content

Instantly share code, notes, and snippets.

@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 March 31, 2024 01:50
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 July 16, 2024 10:30
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 August 18, 2023 12:02 — 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
@johncantrell97
johncantrell97 / satoshistreasure.md
Last active April 15, 2023 15:09
How I Obtained Satoshi's Treasure Keys 1, 2, and 3 in Minutes

Today (April 16th 2019 at noon) the first major clues to discover key #1 was set to be released in a few cities. A QR code with the words 'orbital' were found at these locations and looked like this: (https://imgur.com/a/6rNmz7T). If you read the QR code with your phone you will be directed to this url: https://satoshistreasure.xyz/k1

At this URL you are prompted to input a passphrase to decrypt the first shard. An obvious first guess was to try the word 'orbital' from the QR code. Not suprisingly this worked! This reveals a congratulations page and presents the first key shard:

ST-0001-a36e904f9431ff6b18079881a20af2b3403b86b4a6bace5f3a6a47e945b95cce937c415bedaad6c86bb86b59f0b1d137442537a8.

Now, we were supposed to wait until April 17th to get clues from the other cities for keys #2 and #3 but that wouldn't stop me from digging around with all the new information we had. All that time "playing" notpron (http://notpron.org/notpron/) years ago was going to help me here.

The first thing I noticed was