Skip to content

Instantly share code, notes, and snippets.

View jrhames's full-sized avatar

Francisco Hames jrhames

View GitHub Profile
@jrhames
jrhames / failover.sh
Created May 11, 2016 18:01 — forked from Apsu/failover.sh
An example failover script for dual WAN, using a ping healthcheck and managing default routes appropriately
#!/bin/bash
# Set defaults if not provided by environment
CHECK_DELAY=${CHECK_DELAY:-5}
CHECK_IP=${CHECK_IP:-8.8.8.8}
PRIMARY_IF=${PRIMARY_IF:-eth0}
PRIMARY_GW=${PRIMARY_GW:-1.2.3.4}
BACKUP_IF=${BACKUP_IF:-eth1}
BACKUP_GW=${BACKUP_GW:-2.3.4.5}
#!/usr/bin/ruby
# Create display override file to force Mac OS X to use RGB mode for Display
# see http://embdev.net/topic/284710
require 'base64'
data=`ioreg -l -d0 -w 0 -r -c AppleDisplay`
edids=data.scan(/IODisplayEDID.*?<([a-z0-9]+)>/i).flatten
vendorids=data.scan(/DisplayVendorID.*?([0-9]+)/i).flatten
#!/usr/bin/ruby
# Create display override file to force Mac OS X to use RGB mode for Display
# see http://embdev.net/topic/284710
require 'base64'
data=`ioreg -l -d0 -w 0 -r -c AppleDisplay`
edids=data.scan(/IODisplayEDID.*?<([a-z0-9]+)>/i).flatten
vendorids=data.scan(/DisplayVendorID.*?([0-9]+)/i).flatten
@jrhames
jrhames / moment-holidays.js
Last active January 19, 2023 03:12
Holidays plugin for Moment.JS
//## Moment.JS Holiday Plugin
//
//Usage:
// Call .holiday() from any moment object. If date is a US Federal Holiday, name of the holiday will be returned.
// Otherwise, return nothing.
//
// Example:
// `moment('12/25/2013').holiday()` will return "Christmas Day"
//
//Holidays:
@jrhames
jrhames / moovr.py
Created August 10, 2010 20:59
Moovr reads the movingpictures (a Media Portal Plugin - http://code.google.com/p/moving-pictures/) database and generates a movie list in HTML that you can share with your friends.
'''
Moovr 0.1
by Jr. Hames
http://github.com/jrhames
DESCRIPTION:
Moovr reads the movingpictures (a Media Portal Plugin - http://code.google.com/p/moving-pictures/) database and generates a movie list in HTML that you can share with your friends.
LICENSE:
This software is distribute under Creative Commons Attribution-Noncommercial-Share Alike 3.0. You can read the entire license on: http://creativecommons.org/licenses/by-nc-sa/3.0/