Skip to content

Instantly share code, notes, and snippets.

@luckman212
luckman212 / uptime2.sh
Created May 3, 2024 13:56
poor man's uptime on macOS by parsing JSON output of system_profiler
system_profiler SPSoftwareDataType -json |
jq --raw-output --argjson labels '[ "day", "hour", "minute", "second" ]' '
.SPSoftwareDataType[0].uptime[3:] // empty | split(":") as $uptime |
def pprint:
($uptime[.] | tonumber) as $val |
if $val == 0 then empty else
"\($val) \($labels[.])" + (if $val == 1 then "" else "s" end)
end;
@net02
net02 / prima_theme.json
Created May 3, 2024 13:56
Structurizr's Prima theme
{
"description": "A Custom Theme for Prima C4 models",
"elements": [
{
"shape": "Person",
"tag": "Person"
},
{
"background": "#F2EAF8",
"color": "#8334c2",
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>ThreadLocal</groupId>
<artifactId>ThreadLocal</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>SeleniumThreadLocal</name>
<dependencies>
<dependency>
@choco-bot
choco-bot / Install.txt
Created May 3, 2024 13:55
pcw-tutor v6.0.0 - Failed - Package Tests Results
==> default: Running provisioner: shell...
[ERROR] An error occurred in the underlying SSH library that Vagrant uses.
[ERROR] The error message is shown below. In many cases, errors from this
[ERROR] library are caused by ssh-agent issues. Try disabling your SSH
[ERROR] agent or removing some keys and try again.
[ERROR] If the problem persists, please report a bug to the net-ssh project.
[ERROR] timeout during server version negotiating
@JohnWick92
JohnWick92 / wezterm.lua
Created May 3, 2024 13:55
wezterm config
local wezterm = require("wezterm")
local act = wezterm.action
local config = {}
if wezterm.config_builder then config = wezterm.config_builder() end
config.color_scheme = "Tokyo Night"
config.font = wezterm.font_with_fallback({
{ family = "IosevkaTerm Nerd Font", scale = 1.2}
})
config.window_background_opacity = 0.9
@blineberry
blineberry / supportsWebmentionsBookmarklet.js
Created May 3, 2024 13:55
Supports Webmentions? Bookmarklet
javascript: (() => {
// Set some strings for the common result scenarios.
const support = "Page supports webmentions!";
const noSupport = "Page does not support webmentions :(";
// Create a dialog element and insert into the DOM.
let d = document.createElement('dialog');
document.getElementsByTagName('body')[0].appendChild(d);
// Remove the dialog element when it's closed.
import mido
from time import sleep
import pandas as pd
import matplotlib.pyplot as plt
# MIDI note to value mapping dictionary
note_mapping = {
'C0': 12, 'C#0': 13, 'D0': 14, 'D#0': 15, 'E0': 16, 'F0': 17, 'F#0': 18, 'G0': 19, 'G#0': 20, 'A0': 21, 'A#0': 22, 'B0': 23,
'C1': 24, 'C#1': 25, 'D1': 26, 'D#1': 27, 'E1': 28, 'F1': 29, 'F#1': 30, 'G1': 31, 'G#1': 32, 'A1': 33, 'A#1': 34, 'B1': 35,
'C2': 36, 'C#2': 37, 'D2': 38, 'D#2': 39, 'E2': 40, 'F2': 41, 'F#2': 42, 'G2': 43, 'G#2': 44, 'A2': 45, 'A#2': 46, 'B2': 47,
@HugsLibRecordKeeper
HugsLibRecordKeeper / output_log.txt
Created May 3, 2024 13:54
Rimworld output log published using HugsLib
Log uploaded on Friday, May 3, 2024, 4:54:50 PM
Loaded mods:
Harmony(brrainz.harmony)[mv:2.3.1.0]: 0Harmony(2.3.3), HarmonyMod(2.3.1)
Core(Ludeon.RimWorld): (no assemblies)
Ideology(Ludeon.RimWorld.Ideology): (no assemblies)
Biotech(Ludeon.RimWorld.Biotech): (no assemblies)
HugsLib(UnlimitedHugs.HugsLib)[ov:11.0.3]: 0Harmony(av:2.3.3,fv:1.2.0.1), HugsLib(av:1.0.0,fv:11.0.3)
Enhanced Beliefs(smartkar.enhancedbeliefs): EnhancedBeliefs(1.0.0)
Active Harmony patches:
@nphilbrook
nphilbrook / requirements.txt
Created May 3, 2024 13:54
RUM requirements
packaging==23.1
Requests==2.31.0
// SPDX-License-Identifier: AGPL-3.0-or-later
pragma solidity 0.7.5;
library EnumerableSet {
// To implement this library for multiple types with as little code
// repetition as possible, we write it in terms of a generic Set type with
// bytes32 values.
// The Set implementation uses private functions, and user-facing
// implementations (such as AddressSet) are just wrappers around the
// underlying Set.