Skip to content

Instantly share code, notes, and snippets.

View krzemienski's full-sized avatar

Nick Krzemienski krzemienski

View GitHub Profile
@joekrill
joekrill / docker-compose.yml
Last active April 8, 2024 04:53
Linkwarden Docker Compose
version: "3.9"
volumes:
postgres:
services:
postgres:
image: postgres
restart: unless-stopped
healthcheck:
@acarril
acarril / bootable-win-on-mac.md
Created November 18, 2022 17:49
Create a bootable Windows USB using macOS

For some reason, it is surprisingly hard to create a bootable Windows USB using macOS. These are my steps for doing so, which have worked for me in macOS Monterey (12.6.1) for Windows 10 and 11. After following these steps, you should have a bootable Windows USB drive.

1. Download a Windows disc image (i.e. ISO file)

You can download Windows 10 or Windows 11 directly from Microsoft.

2. Identify your USB drive

After plugging the drive to your machine, identify the name of the USB device using diskutil list, which should return an output like the one below. In my case, the correct disk name is disk2.

@lucaspar
lucaspar / nvenc-install.sh
Last active April 25, 2024 07:01
Installation script of CUDA-accelerated `ffmpeg` with NVIDIA Encoder
#!/bin/bash
# =========================================================================
# Source: https://gist.github.com/lucaspar/27f5e108b80524b315be10b2a9049817
# =========================================================================
# This script will compile and install a static FFmpeg build with
# support for NVENC in Ubuntu. Developed in Ubuntu 23.10,
# with NVIDIA Drivers v535.129.03 and CUDA v12.2 with a GPU
# with CUDA capability 8.6 (RTX 3080) (see ccap below).
# It assumes NVIDA drivers are installed and that you have a
# CUDA-compatible GPU. You can check installed drivers with:
@kepano
kepano / obsidian-web-clipper.js
Last active May 5, 2024 23:29
Obsidian Web Clipper Bookmarklet to save articles and pages from the web (for Safari, Chrome, Firefox, and mobile browsers)
javascript: Promise.all([import('https://unpkg.com/turndown@6.0.0?module'), import('https://unpkg.com/@tehshrike/readability@0.2.0'), ]).then(async ([{
default: Turndown
}, {
default: Readability
}]) => {
/* Optional vault name */
const vault = "";
/* Optional folder name such as "Clippings/" */
@duboisf
duboisf / README.md
Last active April 26, 2024 12:50
Example GitHub graphql queries using the gh cli

List all the default branches of repositories in a specific organisation

gh api graphql --paginate \
    --jq '.data.organization.repositories.nodes[] | .defaultBranchRef.name + "\t" + .name' \
    -F org=SomeOrg \
    -f query='
query($org:String!, $endCursor:String) { 
  organization(login:$org) {
    repositories(first: 100, after: $endCursor, isFork:false, orderBy: {field:NAME, direction:ASC}) {
@duboisf
duboisf / operations.graphql
Last active March 18, 2024 15:46
Add branch protection to a repo using GitHub's Graphql API
fragment branchProtection on BranchProtectionRule {
allowsDeletions
allowsForcePushes
creator {
login
}
id
isAdminEnforced
requiredStatusCheckContexts
requiredApprovingReviewCount
@thistac
thistac / docker-compose.yml
Created March 7, 2021 02:12
Simple Traefik with cloudflare, letsencrypt dns-chalange using secrets
version: "3.9"
services:
traefik:
image: "traefik:v2.4"
container_name: "traefik"
command:
#- "--log.level=DEBUG"
- "--api.insecure=true"
- "--providers.docker=true"
@aperture147
aperture147 / ffmpeg.go
Last active February 8, 2024 22:21
fix make buffer
package main
import (
"bytes"
"io/ioutil"
"log"
"os"
"os/exec"
)
@kevinkub
kevinkub / scriptable-line-chart.js
Last active February 1, 2024 15:18
Simple line chart class for https://scriptable.app 📈
class LineChart {
// LineChart by https://kevinkub.de/
constructor(width, height, values) {
this.ctx = new DrawContext();
this.ctx.size = new Size(width, height);
this.values = values;
}
_calculatePath() {