Skip to content

Instantly share code, notes, and snippets.

@bahamat
bahamat / time-machine.sh
Last active April 30, 2024 19:06
DNS-SD Bonjour service discovery for Time Machine volumes
#!/bin/bash -x
if [[ -z $1 ]]; then
printf 'Must supply a path\n'
exit 1
fi
# We want to advertise a consistent volume UUID that will survive reprovisions.
zone_uuid=$(zonename)
bonjour_name="$(hostname -s).local"
@dalechyn
dalechyn / anvil.ts
Created April 30, 2024 13:06
Start an anvil and otterscan with bun
import { createAnvil } from '@viem/anvil'
import 'dotenv/config'
import { $ } from 'bun'
import path from 'path'
import z from 'zod';
import { fromError } from 'zod-validation-error'
//////////////////////
// Env validation
@mcxiaoke
mcxiaoke / miui-blotware-apps.md
Last active April 30, 2024 19:03
MIUI 13/14 bloatware apps, updated at 20240816

对于所有应用,不建议直接删除,使用adb shell pm disable-user package-name禁用即可,方便出问题时恢复。

DO NOT UNINSTALL:

  • com.miui.securitycenter
  • com.miui.securityadd
  • com.xiaomi.finddevice

(Don’t uninstall these three apps or services from your Xiaomi device. Otherwise, you may encounter device bricking or bootloop issues.)

@aamiaa
aamiaa / CompleteDiscordQuest.md
Last active April 30, 2024 19:03
Complete Recent Discord Quest

Complete Recent Discord Quest

Note

This no longer works in browser!

Note

This no longer works if you're alone in vc! Somebody else has to join you!

How to use this script:

  1. Accept the quest under User Settings -> Gift Inventory
@touilleMan
touilleMan / SimpleHTTPServerWithUpload.py
Last active April 30, 2024 19:02 — forked from UniIsland/SimpleHTTPServerWithUpload.py
Simple Python Http Server with Upload - Python3 version
#!/usr/bin/env python3
"""Simple HTTP Server With Upload.
This module builds on BaseHTTPServer by implementing the standard GET
and HEAD requests in a fairly straightforward manner.
see: https://gist.github.com/UniIsland/3346170
"""
@danielesegato
danielesegato / ChannelSharedFlow.kt
Last active April 30, 2024 18:59
Coroutine: Channel Shared Flow
/*
* Copyright 2022 Daniele Segato
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
<?
# MIT license, do whatever you want with it
#
# This is my invoice.php page which I use to make invoices that customers want,
# with their address on it and which are easily printable. I love Stripe but
# their invoices and receipts were too wild for my customers on Remote OK
#
require_once(__DIR__.'/../vendor/autoload.php');
@jamescarlos
jamescarlos / cache_backup.sh
Created May 27, 2015 10:21
Backup unRAID cache drive
#!/bin/bash
LogFile=/var/log/cache_backup.log
BackupDir=/mnt/disk6/cache_backup
echo `date` "Starting cache drive backup to " $BackupDir >> $LogFile
#Stop plugin services located in /etc/rc.d/
# enter in plugins to stop here, if any
# /etc/rc.d/rc.plexmediaserver stop >> $LogFile
var mediaJSON = { "categories" : [ { "name" : "Movies",
"videos" : [
{ "description" : "Big Buck Bunny tells the story of a giant rabbit with a heart bigger than himself. When one sunny day three rodents rudely harass him, something snaps... and the rabbit ain't no bunny anymore! In the typical cartoon tradition he prepares the nasty rodents a comical revenge.\n\nLicensed under the Creative Commons Attribution license\nhttp://www.bigbuckbunny.org",
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4" ],
"subtitle" : "By Blender Foundation",
"thumb" : "images/BigBuckBunny.jpg",
"title" : "Big Buck Bunny"
},
{ "description" : "The first Blender Open Movie from 2006",
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ElephantsDream.mp4" ],
@AndrasKovacs
AndrasKovacs / OneBRC.hs
Last active April 30, 2024 18:49
1brc
{-# language
BlockArguments
, CPP
, LambdaCase
, MagicHash
, PatternSynonyms
, Strict
, TypeApplications