Skip to content

Instantly share code, notes, and snippets.

View jdpace's full-sized avatar

Jared Pace jdpace

  • GitHub
  • Charlotte, NC
View GitHub Profile
@jdpace
jdpace / gitio
Last active August 29, 2015 14:23 — forked from defunkt/gitio
Turn a github.com URL into a git.io URL.
#!/usr/bin/env ruby
# Usage: gitio URL [CODE]
#
# Turns a github.com URL
# into a git.io URL
#
# Copies the git.io URL to your clipboard.
url = ARGV[0]
code = ARGV[1]
@jdpace
jdpace / pryrc
Last active August 29, 2015 14:23
Allow the gist variable name to be used in pry
# ~/.pryrc
Pry.commands.rename_command('dont bother me', 'gist')
# This allows you to have local variables named gist again
@jdpace
jdpace / plex-trailiers.sh
Last active November 23, 2021 23:40
Plex trailers
#!/opt/bin/bash
# downloads all missing trailers - it goes through all your movies and matchs them up with an entry
# in plex, grabs the imdb id from plex, and then parses the trailer url from the imdb site, then passes
# that to youtube-dl to download the trailer, it skips entries that dont have a matching imdb entry
# or if the trailer already exists
# must have 'sqlite3' and 'youtube-dl' packages (apt-get install sqlite3 youtube-dl)
# set 'mpath' and 'pms' accordingly
export mpath="/volume1/video/Movies/";
export pms="/volume1/Plex/Library/Application Support/Plex Media Server/"; \
@jdpace
jdpace / test.csv
Last active August 29, 2015 14:14
Test Gist
Name Location
jdpace Portland
spicycode Columbus
@jdpace
jdpace / api_example.rb
Created April 22, 2011 13:08
Collector API Example
class AbstractActivityCollector
def run
activities.each do |activity|
persist_activity(activity)
end
end
# To be implemented by subclasses
#
# Returns an array pending activities.
##################################################################
# This file uses PDFKit to render a PDF modeled after a Prawn #
# example. It uses RaphaelJS to generate SVG. #
# #
# Note: There seems to be a bug in wkhtmltopdf that is creating #
# an additional page. Seems to be related to `overflow: hidden`. #
# #
# Prawn PDF: http://majesticseacreature.com/prawn-sample.pdf #
# Prawn Source: http://gist.github.com/441285 #
##################################################################
kinetoscope ~: free
total used free shared buffers cached
Mem: 2048 1955 92 0 16 68
-/+ buffers/cache: 1870 177
Swap: 4095 85 4010
kinetoscope ~: top
top - 12:12:29 up 2 days, 22:59, 2 users, load average: 10.00, 10.00, 10.00
Tasks: 95 total, 11 running, 78 sleeping, 0 stopped, 6 zombie
Cpu(s): 29.3%us, 7.7%sy, 0.0%ni, 52.0%id, 0.2%wa, 0.0%hi, 0.0%si, 10.9%st