Skip to content

Instantly share code, notes, and snippets.

@extratone
extratone / typoraconf.json
Last active September 9, 2022 18:45
My conf.user.json file containing my personal customizations to Typora.
/** For advanced users. */
{
"defaultFontFamily": {
"standard": null, //String - Defaults to "Times New Roman".
"serif": null, // String - Defaults to "Times New Roman".
"sansSerif": null, // String - Defaults to "Arial".
"monospace": null // String - Defaults to "Courier New".
},
"autoHideMenuBar": false, //Boolean - Auto hide the menu bar unless the `Alt` key is pressed. Default is false.
// Array - Search Service user can access from context menu after a range of text is selected. Each item is formatted as [caption, url]
@paulcarroty
paulcarroty / github-actions-vm-cleanup.sh
Last active November 23, 2022 17:40
Wipe Github Actions VM completely when you need more space
#!/bin/bash
# docker stop `docker ps -qa` ; docker rm `docker ps -qa` & docker rmi -f `docker images -qa ` & docker volume rm $(docker volume ls -qf) & docker network rm `docker network ls -q --filter type=custom`
# sudo apt -y purge ghc* azure-cli google-cloud-sdk hhvm google-chrome-stable firefox dotnet* *jdk* *llvm* gcc-10 gcc-9 gcc-8 powershell moby-containerd snapd *php* *ruby* *mysql* moby* mono* mongodb* podman r-base* buildah mecab* kubectl libicu-dev containernetworking-plugins skopeo *dev rust*
# sudo rm -rf /opt /var/lib/gems /var/lib/mysql /var/lib/waagent /var/log /home/linuxbrew /root/.cache /usr/share/{dotnet,swift,rust,miniconda} /usr/local/lib/android /usr/local/graalvm &
# In the end ~70GB will be available.
@extratone
extratone / apps.md
Last active November 23, 2025 20:08
APPS
@sindresorhus
sindresorhus / esm-package.md
Last active November 21, 2025 09:14
Pure ESM package

Pure ESM package

The package that linked you here is now pure ESM. It cannot be require()'d from CommonJS.

This means you have the following choices:

  1. Use ESM yourself. (preferred)
    Use import foo from 'foo' instead of const foo = require('foo') to import the package. You also need to put "type": "module" in your package.json and more. Follow the below guide.
  2. If the package is used in an async context, you could use await import(…) from CommonJS instead of require(…).
  3. Stay on the existing version of the package until you can move to ESM.
@extratone
extratone / embedas.md
Created February 16, 2021 23:30
Embed.as' Supported Platforms

See the original repo for the most up-to-date list.

Supported Providers

  • Airtable
  • Are.na
  • Bandcamp
  • Cinnamon
  • CloudApp
  • Codepen
import SwiftUI
@main
struct ExampleCommandsApp: App {
var body: some Scene {
DocumentGroup(
newDocument: ExampleCommandsDocument()
) { file in
ContentView(
@danielctull
danielctull / Really.swift
Last active June 1, 2022 08:58
I think I found the perfect improvement for force unwrapping in swift.
// EXAMPLE
let string: String? = "Hello World" // String?
let unwrappedString = string.really.srsly.itsfine.honestly.aaarggh // String
print(unwrappedString)
// IMPLEMENTATION
extension Optional {
@beefan
beefan / rem-widget-scriptable.js
Created November 26, 2020 04:37
REM Sleep Helper Widget
// SleepyTime
// when to set your alarm if you go to bed now
// wake up in between REM cycles to feel rested
//
const REM_CYCLE_LENGTH = 90
let widget = new ListWidget()
buildWidget()
// for debugging, allows script to run in app
@alldritt
alldritt / murderbot.js
Last active March 10, 2024 13:28
A script for Scriptable (https://apps.apple.com/us/app/scriptable/id1405459188) that creates a Midsummer Murders Bot (https://twitter.com/midsomerplots) iOS 14 Widget.
async function loadItems() {
let url = "https://midsomerplots.acrossthecloud.net/plot";
let req = new Request(url);
let json = await req.loadJSON();
return json;
}
function createWidget(plot) {
let w = new ListWidget()
@tallguyjenks
tallguyjenks / code.sh
Last active February 21, 2025 08:51
ZettelKasten Sync Code
# To permanently cache the credentials
git config --global credential.helper store
# To ignore files that could cause issues across different workspaces
touch .gitignore
echo ".obsidian/cache
.trash/
.DS_Store" > .gitignore