Skip to content

Instantly share code, notes, and snippets.

View Ravenstine's full-sized avatar

Ten Bitcomb Ravenstine

View GitHub Profile
Ravenstine /
Created December 4, 2023 12:37
Shebang To Run Script In Docker Container

Shebang To Run Script In Docker Container


#!/usr/bin/env docker run --rm alpine:3.18.3 /bin/sh

echo "OS: $(uname -s)"
Ravenstine /
Created September 29, 2023 20:48
How To Run Yggdrasil In Docker

How To Run Yggdrasil In Docker

Want to run Yggdrasil in a Docker container? This is how you can do it.

The keys to getting it working are the following:

  • Give the container access to the TUN interface of the host (or the VM guest in the case of Docker Machine or Docker for Mac)
  • Enable IPv6
  • Assign a dedicated MAC address
Ravenstine /
Last active August 18, 2022 21:55
Apple Screen Sharing w/ Sound

Apple Screen Sharing w/ Sound

macOS comes with a remote desktop application called "Screen Sharing." It is essentially a VNC server and client, and it works really well.

Unfortunately, VNC protocol doesn't include sound, hence neither Screen Sharing for macOS or other VNC clients.

I needed a way to be able to hear various application notifications through Screen Sharing, as well as watch videos or any media hosted by my company. To solve this problem, I came up with a way to support forwarding sound between two Macs.

The idea is to use BlackHole to capture output audio, record it with SoX, and pipe the output to the play command (from SoX) on the remote client. It's not an ideal setup, especially since there's about a second of lag, but it's sufficient if you need to remotely watch videos or hear sound for whatever reason.

Ravenstine / tailwind-colors.css
Created July 23, 2022 01:57
Tailwind colors as CSS variables
:root {
--color-blue-gray-50: hsl(210.0, 40.0%, 98.04%);
--color-blue-gray-100: hsl(210.0, 40.0%, 96.08%);
--color-blue-gray-200: hsl(214.29, 31.82%, 91.37%);
--color-blue-gray-300: hsl(212.73, 26.83%, 83.92%);
--color-blue-gray-400: hsl(215.0, 20.22%, 65.1%);
--color-blue-gray-500: hsl(215.38, 16.32%, 46.86%);
--color-blue-gray-600: hsl(215.29, 19.32%, 34.51%);
--color-blue-gray-700: hsl(215.29, 25.0%, 26.67%);
--color-blue-gray-800: hsl(217.24, 32.58%, 17.45%);
Ravenstine / best-buy-sell-price.js
Last active June 28, 2022 16:02
function bestBuyAndSellPrices(stockPrices) {
let buyDay = null;
let sellDay = null;
let buyPrice = typeof stockPrices[0] !== 'number' ? null : stockPrices[0];
let sellPrice = buyPrice;
stockPrices.forEach((currentBuyPrice, i) => {
const prevPrice = stockPrices[i - 1];
const nextPrice = stockPrices[i + 1];
const isBuyPrice = ((currentBuyPrice - prevPrice) < 0 && (nextPrice - currentBuyPrice) >= 0);
Ravenstine /
Created July 15, 2021 19:43
Convert video to gif with FFMpeg
ffmpeg -i -vf "fps=15,scale=640:-1:flags=lanczos,split[s0][s1];[s0]palettegen[p];[s1][p]paletteuse" -loop 0 output.gif
<bar ...attributes> </bar>
<GrandChild ...attributes />
Ravenstine / app\.js
Last active September 22, 2020 01:18
Named Blocks
import Application from '@ember/application';
import Resolver from 'ember-resolver';
import loadInitializers from 'ember-load-initializers';
import config from './config/environment';
// const callback = Ember.__loader.registry['@ember/canary-features/index'].callback;
// Ember.__loader.registry['@ember/canary-features/index'].callback = function() {
// const features = callback(...arguments);
// features.EMBER_NAMED_BLOCKS = true;
// // debugger