Problem slash Bug in Rails with attr_accessor and Datetime Select Fields
Looks like there is a problem with using the attr_accessor method with datetime form fields http://dev.rubyonrails.org/ticket/8983 In Rails 2.3.2, for me at least, the problem seems to be popping up again. While trying to process a date for credit card v...
Written by Sean Behan on 06/17/2012
Dynamic Attributes in Python Model Class
class Bar():
def __init__(self, **args):
for key in args:
self.__dict__[key] = args[key]
b = Bar(fullname="Monty Python", email="me@monthpython.org")
b.fullname #=> Monty Python
b.email #=>me@montypython.org
Written by Sean Behan on 06/17/2012
How to Find the Directory Locations Your XCode App Uses
You can add this snippet to your application, say for instance in your `viewDidLoad` function, that will print to the XCode console, the location of your app while it's being developed.
// prints the location of asset my-added-file.txt that you've ad...
Written by Sean Behan on 06/06/2018
A Ruby Regex for Removing Links and Images from Text
r = /https?:\/\/[\S]+/i
you_string.gsub(r, '')
Here's the rubular regex to play around with yourself http://rubular.com/r/SRKkYrW4IJ
Written by Sean Behan on 11/14/2013
Ruby strftime() method arguments
Just for reference strftime() arguments in ruby.
Usage `Time.now.strftime("%B/%d/%Y")`
%a weekday name.
%A weekday name (full).
%b month name.
%B month name (full).
%c date and time (locale)
%d day of month [01,31].
%H hour [00,...
Written by Sean Behan on 03/05/2017