My name is Sean Behan.

I write about #software, #SaaS, #consulting and #mobile app development

I work with #Python, #Ruby, #ReactJS and #Postgres

Let's connect on...


VocabReminder
Easily build a great vocabulary without studying! Now on the App Store!
Click here for more info about the app

From the Archives

Regex for Extracting URLs in Plain Text

Here is a Regex for extracting URLs from text. However, these links will not already be hyperlinked or source attribtues from images or iframes. T...


I Just Published My First PHP Package HTMLXPATH

I just wrote and published my first PHP package on Packagist.com. It's available on [packagist.org](https://packagist.org/packages/htmlxpath/htmlxpath...


Matching email addresses in Javascript

Matching email addresses in Javascript regex = /\b[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}\b/img "hello sean@example.com how are you? do...


How to Make Cross Database Queries with Postgres and DBLink Extension

Here are a few snippets for cross database queries. It's important to note that you must be explicit in enumerating the columns and types you are quer...


How to send email with Python, smtplib and Postmark

Here is a quick code snippet showing how to send email via SMTP with Postmark without any dependencies. It assumes you are using Heroku and have added...


Using Selenium to Drive Firefox Browser for Web Automation

There are a lot of practical uses for automating user behavior in a browser. Everything from testing your web application to logging into Twitter and...


How to Import/Export a Database from One Heroku App to Another Heroku App

Heroku is awesome! Let's say we want to copy a production database to a staging database. We can use the `pg:backups:restore` command to accomplis...


Linux Disk Usage Command Recursive

It's short and sweet! du -hs * If you run this command it will tell you the sizes of all the files and folder in the current directory. The...


Reshape an Array of Form Inputs for Flask with getlist()

This is how to reshape an array using Python without Numpy. This is a fairly simple task but it can be a little confusing to wrap your head around....


Trigrams, Bigrams and Ngrams in Python for Text Analysis

Creating trigrams in Python is very simple trigrams = lambda a: zip(a, a[1:], a[2:]) trigrams(('a', 'b', 'c', 'd', 'e', 'f')) # => [('a', 'b',...


How To Create a Dump File in Postgres Compatible with Heroku

When Heroku creates a dump file of your Postgres database it uses the `-Fc` option It is equivalent to running pg_dump -Fc -d name_of_db > nam...


How to Fix xcrun: error: unable to find utility "instruments", not a developer tool or in PATH

I just got a new machine and downloaded XCode. I used git to clone my ReactNative project from Github. I have everything ready to go. But when I run `...


How to Decorate Imported Libs in Python for Jinja Template Filters in Flask

To decorate an imported function in Python you would do something like this # in ./lib.py def function_name(): # function body And then in...


Get Method Name as String in Python

Here is how to get the string representation of a method in Python def my_method_name(): print "Hello World" my_method_name.__name__ #...


Destructuring Dictionaries in Python

Here is a quick and dirty way to destructure dictionaries in [Python] d = {'a':'Apple', 'b':'Banana','c':'Carrot'} a,b,c = [d[k] for k in ('a',...