Skip to content

Instantly share code, notes, and snippets.

View jgillman's full-sized avatar

Joel Gillman jgillman

View GitHub Profile
@jgillman
jgillman / restore.sh
Last active March 8, 2024 17:51
pg_restore a local db dump into Docker
# Assumes the database container is named 'db'
DOCKER_DB_NAME="$(docker-compose ps -q db)"
DB_HOSTNAME=db
DB_USER=postgres
LOCAL_DUMP_PATH="path/to/local.dump"
docker-compose up -d db
docker exec -i "${DOCKER_DB_NAME}" pg_restore -C --clean --no-acl --no-owner -U "${DB_USER}" -d "${DB_HOSTNAME}" < "${LOCAL_DUMP_PATH}"
docker-compose stop db
@jgillman
jgillman / config-sample.ini
Last active March 31, 2018 11:38
An example of setting up PlexPy with a reverse proxy in Nginx
; This is the PlexPy config.ini file.
; Just the two lines needed for the reverse proxy, the rest of the file doesn't
; need to be touched
http_root = /plexpy
http_proxy = 1
@jgillman
jgillman / 1_intro.txt
Last active November 11, 2023 02:33
i3 config from /u/twodogsdave
If this is hard to read in your browser, just copy the text and paste it into your editor.
Turn 'line wrapping' on. :)
This is a 'how to' for anyone interested in a i3 setup and also for anyone currently
using i3 and wants to tweak there setup a little more. I am constantly updating my
i3 config with cool 'stuff.' I hope you enjoy reading and if you use some of the code,
great! I don't know everything and am still learning, too. :)
This is my system settings for i3. Specifically, I use [Manjaro i3](https://forum.manjaro.org/index.php?topic=28022.0).
@jgillman
jgillman / README.md
Last active June 28, 2016 23:34
Domain com to dev toggler

.dev to .com Domain Toggle

This is a javascript bookmarklet that toggles your current domain between a product and local development URL.

For example:

https://example.com/some/path?key=value
Becomes:
http://example.dev/some/path?key=value
@jgillman
jgillman / fedexChecker.js
Created March 17, 2015 19:06
Check the validity of a FedEx tracking number based on their 2011 spec
// Depends on ECMAScript 6 for the `map` and `reduce` functions. They are
// easily replaced with a library like Lodash or Underscore.
var FedExChecker = (function() {
'use strict';
var CHECK_WEIGHT_ARRAY, TRACKING_NUMBER_MAX_LENGTH, digitsToArray;
function FedExChecker() {}
@jgillman
jgillman / dabblet.css
Created July 9, 2014 22:52
The difference between max-width 100% and width 100%
/**
* The difference between max-width 100% and width 100%
*/
.maxwidth {
max-width: 100%;
}
.width {
width: 100%;
@jgillman
jgillman / launch_plex.sh
Created June 3, 2014 04:56
A quick and dirty shell script to turn on the Lightpack, launch Plex, then turn off the Lightpack when Plex exits.
#!/bin/bash
# A quick and dirty shell script to turn on the Lightpack, launch Plex, then
# turn off the Lightpack when Plex exits.
# Turn on Lightpack
(sleep 1; echo "lock"; echo "setstatus:on"; sleep 1; echo "exit") \
| telnet 127.0.0.1 3636;
# Launch Plex Home Theater, and turn off Lightpack on exit
@jgillman
jgillman / pre-commit.sh
Last active August 29, 2015 14:01 — forked from alexbevi/pre-commit.sh
Git pre-commit hook to check all staged Ruby (*.rb/haml/js/coffee) files for debug statements
#!/bin/sh
#
# Git pre-commit hook to check all staged Ruby (*.rb/haml/coffee) files
# for Pry binding references
#
# Installation
#
# cd .git/hooks
# ln -s relative/path/to/pre-commit.sh
#
@jgillman
jgillman / dabblet.css
Created May 5, 2014 18:53
Pseudo-skewed box
/**
* Pseudo-skewed box
*/
html {
background: #f06;
background: linear-gradient(45deg, #f06, yellow);
min-height: 100%;
padding: 8em;
}
@jgillman
jgillman / animation.sass
Created April 7, 2014 22:50
Native Sass mixin for CSS3 animation, no Compass needed.
// Choose what browser prefixes you want based on info you find here:
// http://caniuse.com/#feat=css-animation
// Add vendor prefixes to keyframes
@mixin keyframes($animation-name)
@-webkit-keyframes #{$animation-name}
@content
@-moz-keyframes #{$animation-name}
@content
@keyframes #{$animation-name}