Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env python3
"""Copy Bluesky posts -> Mastodon, skipping ones whose text already exists on Mastodon.
Resumable: records posted Bluesky URIs in STATE_FILE. Honors Mastodon rate limits."""
import os, sys, json, re, time, html, io
import requests
INSTANCE = "https://mastodon.social"
BSKY_FILE = "/tmp/bsky_posts.json"
STATE_FILE = "/tmp/bsky_sync_state.json"
DELAY = float(os.environ.get("SYNC_DELAY", "6")) # seconds between posts ("slowly")
@erikh
erikh / hack.sh
Created March 31, 2012 07:02 — forked from DAddYE/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#

Town OS Functional Specification

Town OS is a self-hosted cloud platform for home users. It runs entirely from a USB drive in RAM, using all system storage for user data. Packaging, storage, and networking are fully integrated. A web UI provides management for non-technical users.

Git Library

All internal git operations use a pure-Go library (go-git/go-git/v5) rather than shelling out to the git CLI.

Client Interface

{"result":{"1":{"line_count":19,"total_amount":-10475},"10":{"line_count":8,"total_amount":4825},"12":{"line_count":3,"total_amount":1800},"13":{"line_count":3,"total_amount":1225},"2":{"line_count":20,"total_amount":-12300},"4":{"line_count":11,"total_amount":12450},"5":{"line_count":11,"total_amount":10375},"6":{"line_count":8,"total_amount":-4825},"7":{"line_count":10,"total_amount":4700},"8":{"line_count":10,"total_amount":3275},"9":{"line_count":9,"total_amount":-10750}}}
# import it into your profile, and create a git repository.
# then run `journal` in the repository. it will automatically
# create a dated filename (appending a number if it already
# exists), open your editor to it, and when you save and
# quit, it'll push it to your git remote.
journal () {
if [ ! -d .git ]
then
echo "Please initialize this directory with git" >&2
// =============================================================================
//
// Waybar configuration
//
// Configuration reference: https://github.com/Alexays/Waybar/wiki/Configuration
//
// =============================================================================
{
// -------------------------------------------------------------------------
#!env bash
case "$1" in
boot)
(sleep 1 && bash $0 fix) &
;;
fix)
exec &>/dev/null
# transform monitors to form a vertical wall
#!env bash
case "$1" in
boot)
(sleep 1 && bash $0 fix) &
;;
fix)
exec &>/dev/null
# transform monitors to form a vertical wall
#!env bash
case "$1" in
boot)
(sleep 5 && bash $0 fix) &
;;
fix)
exec &>/dev/null
# transform monitors to form a vertical wall
#!env bash
case "$1" in
boot)
(sleep 5 && bash $0 fix) &
;;
fix)
xrandr --dpi 192 \
--output DisplayPort-2 --dpi 192 --primary --auto --rotate right --left-of DisplayPort-0 \
--output DisplayPort-1 --dpi 192 --auto --left-of DisplayPort-2 --rotate right \