Git: How to Delete a Branch with an Invalid Name
If you've named a branch beginning with two dashes "--", you're sort of in trouble because git interprets your branch name as a switch/flag. You can skip switches all together
by supplying two dashes before your branch name
git branch -d -- --index_for_...
Written by Sean Behan on 06/17/2012
Rails Migrations and Auto Incrementing Migration Prefix Number
In your environment.rb file turn off timestamped migrations like so:
config.active_record.timestamped_migrations = false
Written by Sean Behan on 06/17/2012
Generate a Gravatar URL with Ruby
To get a Gravatar you need to hash an email address with the MD5 algorithm.
MD5 is a part of the Ruby standard library. Rails loads it by default, but otherwise you will have to require it yourself.
This is a simple implementation.
Gravatar su...
Written by Sean Behan on 04/11/2014
How to Read and Write to a Single Cell Using PHP and Google Spreadsheets API
This post assumes you've created a project with Google's web console and downloaded a client_secret.json file from the credentials page. If not, more info is here..
https://www.twilio.com/blog/2017/03/google-spreadsheets-and-php.html
Note: The tuto...
Written by Sean Behan on 10/11/2018
Extension for Encoding and Decoding Strings in Base64 in Swift
Here is an extension to base 64 encode and decode strings in Swift (3)
extension String {
func fromBase64() -> String? {
guard let data = Data(base64Encoded: self) else {
return nil
}
return String(data: data, encoding: ....
Written by Sean Behan on 05/02/2018