Skip to content

Instantly share code, notes, and snippets.

View rylnd's full-sized avatar

Ryland Herrick rylnd

View GitHub Profile
@Webreaper
Webreaper / docker-compose.yml
Last active December 8, 2025 21:10
Sample Docker-compose file which shows how to set up Sonarr, Radarr, Prowlarr, Lidarr, QBittorrent and a VPN container so that all all traffic from the containers is routed through the VPN. Also includes Plex and get_iplayer containers, which are not routed through the VPN.
# Docker compose to set up containers for all services you need:
# VPN
# Sonarr, Radarr, Lidarr, Qbittorrent
# Non-VPN
# Plex, get_iplayer
# Before running docker-compose, you should pre-create all of the following folders.
# Folders for Docker State:
# /volume1/dockerdata. - root where this docker-compose.yml should live
# /volume1/dockerdata/plex - Plex config and DB
# /volume1/dockerdata/sonarr - Sonarr config and DB
@aphex3k
aphex3k / ffmpeg_cuda.md
Last active November 5, 2025 05:41
Transcoding MPEG2 TS to H.264 MP4

Transcoding MPEG2 TS to H.264 MP4

The goal is to transcode a DVR recording containing one video source in mpeg2 format, any number (typically 2-3) of audio sources in ac-3 format and maybe a subtitle source all together in a transport stream container. In addition the video stream might be interlaced.

The target is a video file playable natively on modern iOS and Android devices using their platforms native and hardware supported playback capabilities.

Target file container and formats

The target file container and supported stream formats are listed below to ensure very good playback compatibility on modern devices and platforms.

  • MP4/M4V container format
@pvcarrera
pvcarrera / sample_data.rake
Last active October 11, 2023 00:56
Load Rails fixtures ignoring PostgreSQL constraints
namespace :db do
desc 'Reset and populate sample data'
task populate_sample_data: [:reset, :drop_constraints, 'fixtures:load', :create_constraints] do
puts 'Fixtures loaded in the database'
end
desc 'Remove all database constraints'
task drop_constraints: [:environment, :create_constraints_script, :drop_constraints_script] do
ActiveRecord::Base.connection.execute(IO.read('tmp/drop_constraints.sql'))
puts 'Constraints dropped'
@paulirish
paulirish / what-forces-layout.md
Last active December 8, 2025 09:19
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.

Element APIs

Getting box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
@itsthatguy
itsthatguy / dosh.sh
Last active August 29, 2015 14:22 — forked from bigtiger/dosh.sh
dosh() {
if [ "$1" = "-h" ] || [ "$1" = "--help" ] || [ "$1" = "help" ]
then
read -r -d '' VAR << EOM
Usage: dosh [argument]
Arguments:
ls (default) lists running containers
[name|id] runs bash for specified container
help, -h, --help brings up this help
@mikesmullin
mikesmullin / watch.sh
Last active April 26, 2023 05:20
watch is a linux bash script to monitor file modification recursively and execute bash commands as changes occur
#!/usr/bin/env bash
# script: watch
# author: Mike Smullin <mike@smullindesign.com>
# license: GPLv3
# description:
# watches the given path for changes
# and executes a given command when changes occur
# usage:
# watch <path> <cmd...>
#
@mbostock
mbostock / README.md
Last active June 7, 2023 18:33
Underscore’s Equivalents in D3

Collections

each(array)

Underscore example:

_.each([1, 2, 3], function(num) { alert(num); });
@piscisaureus
piscisaureus / pr.md
Created August 13, 2012 16:12
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@srushti
srushti / gist:2651900
Created May 10, 2012 08:33
Vim commands to convert a Test::Unit/Shoulda to RSpec
%s/def test_\(.*\)/it "\1" do
%s/ should / it /
%s/setup do/before(:each) do/
%s/def setup/before(:each) do/
%s/assert_true \(.*\)/\1.should be_true/
%s/assert \(.*\)/\1.should be_true/
%s/assert_false \(.*\)/\1.should be_false/
%s/assert_equal(\(.*\),\(.*\))/\2.should == \1/
%s/assert_equal \(.*\),\(.*\)/\2.should == \1/
%s/assert_nil \(.*\)/\1.should be_nil/
@erikh
erikh / hack.sh
Created March 31, 2012 07:02 — forked from DAddYE/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#