Skip to content

Instantly share code, notes, and snippets.

View jmade's full-sized avatar
🏠
Working from home

Justin Madewell jmade

🏠
Working from home
  • Indianapolis, IN
View GitHub Profile
@gbhorwood
gbhorwood / put_to_s3.sh
Last active July 16, 2025 10:07
upload file to s3 bash script
#!/bin/bash
####
# Upload one file to configured S3 bucket
#
# 20240418 gbh
#
# Accepts the path to the file to upload as its only command-line argument. Uploads
# to the S3 bucket configured in the 'Configuration' block below.
#
@johndturn
johndturn / launchd-for-services.md
Last active October 24, 2025 16:53
Overview of using launchd to set up services on a macOS machine.

launchd - Script Management in macOS

What is it?

  • Used on macOS for managing agents and daemons and can be used to run scripts at specified intervals
    • macOS's competitor to cron, along with other things
  • Runs Daemons and Agents

What is a Daemon?

@noelhibbard
noelhibbard / Doorbell.env
Last active July 18, 2025 06:38
This gist shows how to pull the local stream from a Wyze camera and then push it to an RTMP server.
# Edit and rename this file and then place it in /etc/wyzecam-to-rtmp
WYZE_EMAIL="joeblow@example.com"
WYZE_PASSWORD="wyzepasshere"
WYZE_CAMERA_NAME="Doorbell"
RTMP_URL="rtmp://127.0.0.1/live/doorbell"
// Based on Kickstarter-Prelude version
// https://github.com/kickstarter/Kickstarter-Prelude/blob/master/Prelude-UIKit/UIImage.swift
extension UIImage {
/**
- parameter color: A color.
- returns: A 1x1 UIImage of a solid color.
*/
static func pixel(ofColor color: UIColor) -> UIImage {
let lightModeImage = UIImage.generatePixel(ofColor: color, userInterfaceStyle: .light)
@m-radzikowski
m-radzikowski / script-template.sh
Last active October 9, 2025 00:41
Minimal safe Bash script template - see the article with full description: https://betterdev.blog/minimal-safe-bash-script-template/
#!/usr/bin/env bash
set -Eeuo pipefail
trap cleanup SIGINT SIGTERM ERR EXIT
script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd -P)
usage() {
cat <<EOF
Usage: $(basename "${BASH_SOURCE[0]}") [-h] [-v] [-f] -p param_value arg1 [arg2...]
@IsaacXen
IsaacXen / README.md
Last active November 4, 2025 13:22
(Almost) Every WWDC videos download links for aria2c.
#-*-coding:utf8;-*-
import androidhelper
droid = androidhelper.Android()
apps = droid.getLaunchableApplications().result
print(apps)
running_packages = droid.getRunningPackages().result
print(running_packages)
@vaughany
vaughany / .tmux.conf
Last active July 16, 2024 23:03
A shell script to open tmux with a selection of windows and panes.
# Remap prefix from 'C-b' to 'C-a'.
unbind C-b
set-option -g prefix C-a
bind-key C-a send-prefix
# Reload config file.
bind-key r source-file ~/.tmux.conf\; display ' Reloaded tmux config.'
# Split panes using | and -.
bind-key | split-window -h -c '#{pane_current_path}'
@vinczebalazs
vinczebalazs / SheetModalPresentationController.swift
Last active October 20, 2025 09:05
A presentation controller to use for presenting a view controller modally, which can be dismissed by a pull down gesture. The presented view controller's height is also adjustable.
import UIKit
extension UIView {
var allSubviews: [UIView] {
subviews + subviews.flatMap { $0.allSubviews }
}
func firstSubview<T: UIView>(of type: T.Type) -> T? {
allSubviews.first { $0 is T } as? T
@bakman2
bakman2 / octoprint.md
Last active September 19, 2024 21:01
Octoprint IP Camera

How to use Octoprint with an IP camera that has an RTSP stream available

Optional: For Wyze cam only

Install Dafang Hacks on the Wyze Cam.

Once running and all is functional, continue. Set video bitrate to 1500, VBR, 30fps.

Installation