Skip to content

Instantly share code, notes, and snippets.

Thomas Roberts thomasjpr

  • Austin, TX
Block or report user

Report or block thomasjpr

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View keybase.md

Keybase proof

I hereby claim:

  • I am thomasjpr on github.
  • I am thomasjpr (https://keybase.io/thomasjpr) on keybase.
  • I have a public key ASBgtUE00deKDQFZAyx_I-W3w3hR0AAsJRLLr8NmabvoLQo

To claim this, I am signing this object:

@thomasjpr
thomasjpr / bbedit-new-markdown-note-to-dropbox.scpt
Created Jun 13, 2014
Create a new Markdown document in BBEdit and save the new file to a predetermined location, prompting the user to rename it. I keep all of my "notes" in a folder in my Dropbox.
View bbedit-new-markdown-note-to-dropbox.scpt
tell application "BBEdit"
activate
make new document
set theDate to short date string of (current date)
set text of document 1 to theDate as text
save document 1 to "/Users/YOURUSERNAME/Dropbox/Notes/NewNote.md"
set old_name to name of text window 1
set dialog_result to display dialog "" default answer (theDate) & " - " & ¬
".md" buttons {"Cancel", "Save"} default button 2 ¬
with icon note ¬
View bbedit-open-file-in-foldingtext.scpt
-- Open the currently active BBEdit document using FoldingText.
tell application "BBEdit"
activate
-- Ask BBEdit for it's active document.
set the_document to active document of text window 1
-- If the file doesn't alreay exist, ask the user to save it.
if not the_document's on disk then
save the_document
View pipe-to-tab.pl
#!/usr/bin/perl
use File::Basename qw(basename);
$me = basename ($0);
if ( $#ARGV < 0 )
{
print "Usage : $me <CSV File Name>\n";
exit;
@thomasjpr
thomasjpr / pipe-to-comma.pl
Created Apr 13, 2014
convert pipe-delimited input to comma-delimited output
View pipe-to-comma.pl
#!/usr/bin/perl
use File::Basename qw(basename);
$me = basename ($0);
if ( $#ARGV < 0 )
{
print "Usage : $me <CSV File Name>\n";
exit;
@thomasjpr
thomasjpr / mobile browser regex
Created Mar 6, 2014
PHP regex to detect mobile browsers
View mobile browser regex
/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i
@thomasjpr
thomasjpr / insert timestamp
Created Jan 5, 2014
insert timestamp for sublime text.
View insert timestamp
# -*- coding: utf-8 -*-
from datetime import datetime
import sublime_plugin
class TimestampCommand(sublime_plugin.EventListener):
"""Expand `isoD`, `now`, `datetime`, `utcnow`, `utcdatetime`,
`date` and `time`
"""
View directions.py
#!/usr/bin/env python
# MapQuest API Turn-by-turn script
#
# Generates driving directions from a starting location
# to a series of destinations in a CSV, used to print
# maps for volunteers delivering food to the less-fortunate
#
# CSV format - place in a file named `list.csv`
# Name, Street, Zipcode, Phone, Count
You can’t perform that action at this time.