Simple SQL for Counting New Signups
Here is a little snippet that will return new signups (or new records) for today
select id, email, created_at::date date from signups
where email not in (select distinct email from signups where created_at < current_date)
Written by Sean Behan on 07/13/2017
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
Natural Dog Training Buzz
NDT Buzz is a companion news site to Natural Dog Training.
News and information about Natural Dog Training is generated on the web from many different sources. Blogs, tweets and comments are aggregated using the Feedzirra Ruby Gem. The site lets NDT use...
Written by Sean Behan on 06/17/2012
Rails Find All by Birthday: How to Find Upcoming Birthdays with ActiveRecord
There are a few ways to solve this problem. However, I think the easiest is to cache the day of the year that the user is born on as an integer. If stored alongside the timestamp we can quickly get a list but properly handle the full birthday elsewhere, s...
Written by Sean Behan on 06/17/2012
Change default ssh port number on Ubuntu
Login as the root user or as a user that can execute sudo commands.
#open this file for editing...
vim /etc/ssh/sshd_config
Find the line that reads
Port 22
Change this to an different and an available port number...
Port 8000
Next reload ssh
/etc/...
Written by Sean Behan on 06/17/2012