Skip to content

Instantly share code, notes, and snippets.

View Michaelvilleneuve's full-sized avatar

Michaël Villeneuve Michaelvilleneuve

View GitHub Profile
@chsh
chsh / pg_pub_sub.rb
Last active May 2, 2024 08:13
PostgreSQL LISTEN/NOTIFY example for ruby
#
# A:
# pubsub = PgPubSub.new('channelname')
# pubsub.subscribe do |data|
# puts "data: #{data} is coming!"
# end
#
# B:
# pubsub = PgPubSub.new('channelname')
# pubsub.publish("hello world")
@JamesMGreene
JamesMGreene / gitflow-breakdown.md
Last active June 22, 2024 03:44
`git flow` vs. `git`: A comparison of using `git flow` commands versus raw `git` commands.

Initialize

gitflow git
git flow init git init
  git commit --allow-empty -m "Initial commit"
  git checkout -b develop master

Connect to the remote repository

@jackrg
jackrg / dates_international.rb
Created June 13, 2012 23:38
Ruby International Date Parser
# -*- coding: utf-8 -*-
#
# Purpose:
# Extend the date parsing capabilities of Ruby to work with dates with international month names.
#
# Usage:
#
# Date.parse_international(date_string)
# DateTime.parse_international(date_string)
# date_string.to_international_date