Skip to content

Instantly share code, notes, and snippets.

@lyrixx
lyrixx / .gitignore
Last active July 28, 2023 14:13
UUID generation in PHP
/vendor/
@nagleaidan
nagleaidan / ngrok-plex.py
Created November 4, 2019 23:17
Run plex through ngrok
#!/usr/bin/python3
from plexapi.myplex import MyPlexAccount
import sys
import json
import requests
import time
# need time for ngrok to start up before requesting data
print("Waiting 15 seconds for ngrok to start up")
@lyrixx
lyrixx / HardCoreDebugLogger.php
Last active October 24, 2025 14:52
Hardcore Debug Logger
<?php
const STREAM_OPEN_FOR_INCLUDE = 128;
final class HardCoreDebugLogger
{
public static function register(string $output = 'php://stdout')
{
register_tick_function(function () use ($output) {
$bt = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 1);
@bitinn
bitinn / finder-tab-restore.applescript
Created January 2, 2019 07:05
restore finder tabs after close
tell application "Finder"
activate
-- Get current user's name
tell application "System Events"
set currentUser to (name of current user)
end tell
-- for cleanliness
close every window
@menushka
menushka / airdropSorter.scpt
Created December 30, 2018 22:47
A Folder Action script written in AppleScript used to separate AirDropped files into a different folder other than the default Downloads folder
property AIRDROP_FOLDER : "Path:to:AirDrop:Folder:in:Alias:format"
property QUARANTINE_KEY : "59"
property GET_QUARANTINE_COMMAND_START : "ls -l -@ '"
property GET_QUARANTINE_COMMAND_END : "' | tr '\\n' ' ' | sed 's/.*com\\.apple\\.quarantine\\s*\\(\\d*\\)/ \\1/' | awk '{$1=$1};1'"
on adding folder items to this_folder after receiving added_items
repeat with i from 1 to length of added_items
set current_item to item i of added_items
set quarantine_type to getQuarantineType(POSIX path of current_item)
@Artistan
Artistan / a ngrok_background.sh
Last active February 23, 2024 22:02 — forked from rjz/ngrok_hostname.sh
Get ngrok hostname from command line
#!/bin/sh
########################################################################################
# I do not need to use the ngrok subdomains...
# start ngrok for my local box (vagrant homestead) in th background
# get the cname from command line for the ngrok alias
# update my subdomain cname to point at new ngrok name
# use it!!!
########################################################################################
# requires ngrok and jq installed.
@miguelmota
miguelmota / process_names.txt
Last active August 13, 2024 09:58
macOS process whitelist
# not an exhaustive list
nsurlsessiond "icloud sync"
fseventsd "macos file system events"
WindowServer "macos windows"
DisplayLinkManager "macos driver"
configd "macos dynamic configuration"
displaypolicyd "macos process"
CommCenter "macos keychain"
kernel_task "macos kernel"
@Propaganistas
Propaganistas / MailHog configuration
Last active March 23, 2025 02:17
Laravel MailHog SMTP configuration
# Mailhog
MAIL_MAILER=smtp
MAIL_HOST=0.0.0.0
MAIL_PORT=1025
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null
@mackjoner
mackjoner / gist:220c2519868d68a0b44818a7dc4e1f53
Created November 20, 2017 10:07
How to delete all (or most) jobs from a beanstalk tube from the shell
#!/usr/bin/expect -f
# Filename: beanstalk-purge
set timeout 1
spawn telnet [lindex $argv 0] [lindex $argv 1]
sleep 1
send "use [lindex $argv 2]\n"
expect "USING"
for {set i 1} {$i < [lindex $argv 3]} { incr i 1 } {
@lmammino
lmammino / example.json
Created November 6, 2017 16:00
A sample message coming from SQS with a payload coming from SNS
{
"Messages": [
{
"Body": "{\n \"Type\" : \"Notification\",\n \"MessageId\" : \"abcdef01-2345-6789-0abc-defg123456783\",\n \"TopicArn\" : \"arn:aws:sns:eu-west-1:123456789012:ticketless-ticketPurchased\",\n \"Message\" : \"{\\\"ticket\\\":{\\\"id\\\":\\\"abcdef01-2345-6789-0abc-defg123456784\\\",\\\"createdAt\\\":1509980177897,\\\"name\\\":\\\"Alex Smith\\\",\\\"email\\\":\\\"[email protected]\\\",\\\"gig\\\":\\\"nirvana-cork-1991\\\"},\\\"gig\\\":{\\\"capacity\\\":2300,\\\"collectionPoint\\\":\\\"29 South Main Street, Centre, Cork City, Co. Cork, Ireland\\\",\\\"collectionTime\\\":\\\"13:00\\\",\\\"slug\\\":\\\"nirvana-cork-1991\\\",\\\"originalDate\\\":\\\"1991-08-20\\\",\\\"venue\\\":\\\"Cavern Club\\\",\\\"bandName\\\":\\\"Nirvana\\\",\\\"city\\\":\\\"Cork\\\",\\\"date\\\":\\\"2019-06-21\\\",\\\"image\\\":\\\"nirvana.jpg\\\",\\\"year\\\":\\\"1991\\\",\\\"collectionPointMap\\\":\\\"map-nirvana-cork-1991.png\\\",\\\"description\\\":\\\"Lorem Ipsum\\\",\\\"price\\\":\\\"1666.60\\\"}}\",\n \"