Skip to content

Instantly share code, notes, and snippets.

// Run any SwiftUI view as a Mac app.
import Cocoa
import SwiftUI
NSApplication.shared.run {
VStack {
Text("Hello, World")
.padding()
.background(Capsule().fill(Color.blue))
@elijahc
elijahc / jupyter-hub-setup.md
Created November 8, 2017 02:56
Setting up Jupyterhub with multiple virtualenv kernels managed with pyenv
@nathandaly
nathandaly / BaseResource.php
Last active May 13, 2024 22:35
Tenancy for Laravel & Filament V3 (Tenant per database)
<?php
/**
* Below is an the extended Filament resource your tenant panel resources
* will have to extend so that the queries are scoped properly.
*/
namespace App\Filament;
use Filament\Resources\Resource;
@chrisdone
chrisdone / Printf.idr
Last active May 13, 2024 22:34
Type-safe dependently-typed printf in Idris
module Printf
%default total
-- Formatting AST.
data Format
= FInt Format
| FString Format
| FOther Char Format
| FEnd
@Joao-Peterson
Joao-Peterson / gmk67-manual.md
Last active May 13, 2024 22:34
GMK67 manual (English)
@JustinFincher
JustinFincher / Table.swift
Created July 28, 2023 02:55
Recursive Outline Table
import SwiftUI
struct TestModel: Identifiable {
let id = UUID()
var children: [TestModel]? {
(0..<5).map { _ in
TestModel()
}
}
}
@Ivoah
Ivoah / p8.py
Created April 4, 2016 17:23
Download all PICO-8 carts from lexaloffle BBS
from requests import get
from bs4 import BeautifulSoup
import re
import os
def make_filename(fname):
for c in ',! ().':
fname = fname.replace(c, '_')
while fname != fname.replace('__', '_'):
fname = fname.replace('__', '_')
@AlexString
AlexString / InstallPipewireFedora.md
Created December 7, 2021 19:30
Install Pipewire on Fedora

Install Pipewire on Fedora

pactl info to show which audio server is running. In occasions this tends to fail showing Connection failure: connection refused. I think this is saying that there is no connection to an audio server so you'll need to enable manually the service using systemctl. please comment about it if you know more of this.

Install pipewire

If you try installing pipewire without removing pulseaudio you'll get a conflict message complaining about it.

@umayr
umayr / recover-deleted-branch.sh
Created April 1, 2016 11:41
How to recover a deleted branch
## Pre-requisite: You have to know your last commit message from your deleted branch.
git reflog
# Search for message in the list
# a901eda HEAD@{18}: commit: <last commit message>
# Now you have two options, either checkout revision or HEAD
git checkout a901eda
# Or
git checkout HEAD@{18}