Skip to content

Instantly share code, notes, and snippets.

View bobpattersonjr's full-sized avatar

Bob Patterson Jr bobpattersonjr

View GitHub Profile
@schacon
schacon / better-git-branch.sh
Created January 13, 2024 18:41
Better Git Branch output
#!/bin/bash
# Colors
RED='\033[0;31m'
GREEN='\033[0;32m'
NO_COLOR='\033[0m'
BLUE='\033[0;34m'
YELLOW='\033[0;33m'
NO_COLOR='\033[0m'
@ajkerrigan
ajkerrigan / start_mosh.sh
Created July 9, 2020 03:28
Start Mosh with AWS SSM Session Manager
#!/bin/bash
#
# Mush mosh and SSM sessions together.
#
# Run mosh-server on an EC2 instance as part of an AWS Session Manager SSH
# session, and feed the output into mosh-client locally. This is helpful
# if you have an EC2 instance which:
#
# * Is publicly addressable
# * Has a predictable Name tag but a shifting IP
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>EnvironmentVariables</key>
<dict>
<key>PATH</key>
<string>/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin</string>
</dict>
<key>Label</key>
@cyle
cyle / giftagger.php
Created July 8, 2015 15:22
Tumblr GIF Tagger
<?php
/*
tumblr gif tagger
goes through your tumblr photo posts, finds .gifs, and tags em #gif
so that they can show up in https://tumblr.com/tv/@your-blog-here
this was made to be run via command line, i.e. `php giftagger.php`
@lowjoel
lowjoel / sleepbot-migrate-to-sleep_as_android.rb
Last active July 13, 2019 10:57
Migrates SleepBot data to Sleep as Android's format
require 'csv'
# Parses CSV-exported data from SleepBot
def parse_export(row)
# Parse the wake up date
date_to = row[0].split('/')
date_to = Time.new(2000 + date_to[2].to_i, date_to[1], date_to[0])
# Parse the wake up/sleep times
time_from = row[1].split(':')
@dergachev
dergachev / GIF-Screencast-OSX.md
Last active April 28, 2025 00:02
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

@donatj
donatj / ColorCLI.php
Created October 26, 2011 03:34
Simple CLI color class
<?php
class ColorCLI {
static $foreground_colors = array(
'bold' => '1', 'dim' => '2',
'black' => '0;30', 'dark_gray' => '1;30',
'blue' => '0;34', 'light_blue' => '1;34',
'green' => '0;32', 'light_green' => '1;32',
'cyan' => '0;36', 'light_cyan' => '1;36',
@benjchristensen
benjchristensen / index.html
Created August 16, 2011 03:21
Animated Line Graphs / Sparklines using SVG Path and d3.js
<html>
<head>
<title>Animated Sparkline using SVG Path and d3.js</title>
<script src="http://mbostock.github.com/d3/d3.v2.js"></script>
<style>
/* tell the SVG path to be a thin blue line without any area fill */
path {
stroke: steelblue;
stroke-width: 1;
fill: none;
@bobpattersonjr
bobpattersonjr / branch_switch
Created March 9, 2011 15:57
git branch switching script
#!/usr/bin/perl
#March 9th 2011
#fisrt pass at branch switch script
#author bob patterson <bob at bobpattersonjr dot com>
sub trim($);
print "fetching all branchs and tags\n";
`git fetch;git fetch --tags`;
$new_branch = trim($ARGV[0]);
$non_branch_test = `git branch|tr -d ' '|grep -x $new_branch`;
@bwmcadams
bwmcadams / tail_profile.py
Created February 26, 2011 14:32
Tail the Slow Query Log on MongoDB
#!/usr/bin/python
# Connects to localhost, 27017 by default
import sys
import pymongo
import time
if len(sys.argv) < 2:
print >> sys.stderr, "Usage: ./tail_profile.py <dbName> [hostname] [port]"
sys.exit(-1)