Skip to content

Instantly share code, notes, and snippets.

View jasonmadigan's full-sized avatar

Jason Madigan jasonmadigan

View GitHub Profile
@jasonmadigan
jasonmadigan / client.html
Created August 17, 2010 18:43
WebSocket Test
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html lang="en">
<head>
<title>
Websocket Test
</title>
<script src='http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js' type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function() {
function debug(str){ $("#debug").append("<p>" + str + "<\/p>"); };
#!/usr/bin/ruby
require 'socket.so'
class UDPServer
def initialize(port)
@port = port
end
def start
@socket = UDPSocket.new
@jasonmadigan
jasonmadigan / fix_trailing_comma.pl
Created November 15, 2011 12:38
Fix trailing JavaScript commas
#!/usr/bin/perl
use Getopt::Long;
my $verbose;
my $overwrite;
my $renamenew;
my $append;
my $help;
@jasonmadigan
jasonmadigan / gist:1367630
Created November 15, 2011 17:09
Sublime Text Multiline key bindings
[
{ "keys": ["alt+shift+up"], "command": "select_lines", "args": {"forward": false} },
{ "keys": ["alt+shift+down"], "command": "select_lines", "args": {"forward": true} }
]
@jasonmadigan
jasonmadigan / hack.sh
Created April 3, 2012 19:47 — forked from erikh/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
#
@jasonmadigan
jasonmadigan / 404_finder.rb
Created August 24, 2012 09:55
404 Finder - Simple Ruby site crawler, finds 404s
#!/usr/bin/env ruby
# Simple 404 finder
require 'rubygems'
require 'anemone'
url = ARGV[0]
if url.nil?
@jasonmadigan
jasonmadigan / keybase.md
Created September 22, 2014 16:26
keybase.md

Keybase proof

I hereby claim:

  • I am jasonmadigan on github.
  • I am jasonmadigan (https://keybase.io/jasonmadigan) on keybase.
  • I have a public key whose fingerprint is EF06 149D 1472 7CDE CA2C 7848 932D 1F08 FEDB 52CF

To claim this, I am signing this object:

{
"users": [{
"gender": "female",
"name": {
"title": "miss",
"first": "alison",
"last": "reid"
},
"location": {
"street": "1097 the avenue",
@jasonmadigan
jasonmadigan / google_calendar_mass_decline.js
Last active November 2, 2017 09:17
Google App Script to decline events over a date range
// https://www.jasonmadigan.com/2017/07/03/declining-google-calendar-events-en-masse/
function GCalHoliday() {
var fromDate = new Date('July 17, 2017 00:00:00 +0100');
var toDate = new Date('August 8, 2017 23:30:00 +0100');
var calendarName = '<Your Calendar - e.g. [email protected]>';
var calendar = CalendarApp.getCalendarsByName(calendarName)[0];
var events = calendar.getEvents(fromDate, toDate, {});
Logger.log('Events: ' + events.length);
@jasonmadigan
jasonmadigan / frigate_test_clip.md
Last active March 13, 2024 19:36
Frigate Test Camera

Frigate Test Clip

To tune Frigate, it can sometimes be useful to input saved clips in order to see how detection works. I've found the easiest way to accomplish this is by grabbing a clip (say, from your NVR), and streaming this on a loop via RTSP to Frigate. This will let you tune settings with an existing configuration, which is a bit different to using process_clip.py that's included with Frigate.

Pre-requisites

  • A sample clip, in a format supported by ffmpeg (.mp4 is good)
  • Docker on a machine that'll do the streaming
  • A working ffmpeg install. I'm using a mac, so I typically install via Brew: brew install ffmpeg