Skip to content

Instantly share code, notes, and snippets.

View jordinl's full-sized avatar

Jordi Noguera jordinl

View GitHub Profile
{
"radars": [
{
"id": "infrastructure",
"points": [
{
"repo": "https://github.com/kubernetes/kubernetes",
"level": "adopt"
},
{
@jordinl
jordinl / older-postgres-postgis.sh
Created April 5, 2019 09:32
Install older versions of postgres and postgis
cd "$(brew --repo homebrew/core)"
# these are for postgres 10.6 and postgis 4.4
# if another version is needed execute `git log -- Formula/postgresql.rb`
git checkout cec7d3b30 Formula/postgresql.rb
git checkout 29307321f Formula/postgis.rb
brew install postgres
brew install postgis
@jordinl
jordinl / scheduler_worker.rb
Last active August 9, 2018 16:35
Add periodic jobs to Sidekiq
class SchedulerWorker
include Sidekiq::Worker
sidekiq_options queue: 'critical'
SCHEDULE = {
FirstWorker => -> (time) { time.min == 5 },
SecondWorker => -> (time) { time.min == 0 && time.hour == 9 },
ThirdWorker => -> (time) { time.min % 10 == 0 },
}
@jordinl
jordinl / operating_hours_comparison.rb
Created March 5, 2017 12:18
Comparison of execution time between Operating Hours gem and Business Time gem
require 'holidays'
require 'business_time'
require_relative 'lib/operating_hours'
COL_WIDTH = 15
def print_row(row)
puts row.map { |cell| cell.to_s.ljust(COL_WIDTH) }.join(' | ')
end