Skip to content

Instantly share code, notes, and snippets.

View raylee's full-sized avatar

Ray Lee raylee

View GitHub Profile
@gruber
gruber / Split Tabs to New Window.scpt
Last active May 5, 2024 16:58
An AppleScript for Safari to move all tabs in the frontmost window, from the current tab to the rightmost (last) tab, to a new window.
use AppleScript version "2.4" -- Yosemite (10.10) or later
use scripting additions
(*
Original script: John Gruber (https://daringfireball.net/linked/2023/12/05/an-applescript-for-safari-split-tabs-to-new-window)
Much more elegant version: Leon Cowle (https://github.com/leoncowle)
Even more elegant version: https://stackoverflow.com/questions/54066100/applescript-to-split-safari-tabs-into-new-window/54089865#54089865
Worth a warning: "moving" tabs with this script doesn't actually move them like
drag-and-drop does. The tabs "moved" by this script will reload in the new window,
@bsag
bsag / README.md
Last active July 12, 2023 19:38
Selected files from my standalone Nix/Home Manager set up on macOS to illustrate the general approach

These files illustrate the way that I have set up Nix and Home Manager for standalone use on macOS on both an Intel and Apple Silicon machine, in case the examples are useful to anyone. Some of the configuration is separated out into separate files in configs/ which get imported in home.nix. Some of my existing dotfiles are placed in dotfiles/ and then symlinked in by Nix to the location that that the system expects to find them.

It is a work in progress so currently I am handling installation of R separately.

@stammw
stammw / yocto.nix
Created November 15, 2020 06:28
yocto.nix
{ pkgs ? import <nixpkgs> {}, ...}:
with pkgs;
(pkgs.buildFHSUserEnv {
name = "yocto-env";
# Packages Yocto is expecting on the host system by default
targetPkgs = pkgs: (with pkgs; [
bash
bashInteractive
#!/usr/bin/awk -f
# This program is a copy of guff, a plot device. https://github.com/silentbicycle/guff
# My copy here is written in awk instead of C, has no compelling benefit.
# Public domain. @thingskatedid
# Run as awk -v x=xyz ... or env variables for stuff?
# Assumptions: the data is evenly spaced along the x-axis
# TODO: moving average
@endolith
endolith / WAV interpretation.md
Last active June 27, 2024 17:02
Interpretation of WAV file sample data and asymmetry

How to handle asymmetry of WAV data?

WAV files can store PCM audio (WAVE_FORMAT_PCM). The WAV file format specification says:

The data format and maximum and minimums values for PCM waveform samples of various sizes are as follows:

Sample Size Data Format Maximum Value Minimum Value
One to eight bits Unsigned integer 255 (0xFF) 0
Nine or more bits Signed integer i Largest positive value of i Most negative value of i
@Irio
Irio / Dockerfile
Last active April 22, 2024 18:12
GCP Serverless scrapers
FROM golang:1.12 as build
WORKDIR $GOPATH/src/github.com/Irio/wohnung
COPY scraper scraper
COPY main.go .
RUN go get -d -v ./...
RUN go install
FROM gcr.io/distroless/base
@pamolloy
pamolloy / README.md
Last active May 12, 2024 04:17
Mesh network using VXLAN over Wireguard
@rikonor
rikonor / main.go
Created January 19, 2019 02:43
Server Sent Events (SSE) Example in Go
package main
import (
"fmt"
"log"
"net/http"
"sync"
"time"
)
@ubergesundheit
ubergesundheit / readme.md
Last active June 24, 2024 06:57
systemd traefik.service

systemd Service Unit for Traefik

Adapted from caddy systemd Service Unit

The provided file should work with systemd version 219 or later. It might work with earlier versions. The easiest way to check your systemd version is to run systemctl --version.

Instructions

We will assume the following:

@mholt
mholt / macapp.go
Last active June 19, 2024 16:05
Distribute your Go program (or any single binary) as a native macOS application
// Package main is a sample macOS-app-bundling program to demonstrate how to
// automate the process described in this tutorial:
//
// https://medium.com/@mattholt/packaging-a-go-application-for-macos-f7084b00f6b5
//
// Bundling the .app is the first thing it does, and creating the DMG is the
// second. Making the DMG is optional, and is only done if you provide
// the template DMG file, which you have to create beforehand.
//
// Example use: