Skip to content

Instantly share code, notes, and snippets.

View nbarthel's full-sized avatar

Nic Barthelemy nbarthel

View GitHub Profile
@jfeaver
jfeaver / rrule_parse.rb
Last active August 20, 2023 06:11
Parse full RRULEs to pass on to the rrule gem
# frozen_string_literal: true
# The rrule gem parses only the recurring rules of the RRULE specification.
# That is, the part that comes after "RRULE:" on the last line of an RRULE. To
# include the DTSTART, and EXDATE as options to the rrule gem, let's add our
# own interface. We remove the "RRULE:" and parse other rules and send them to
# the gem with the desired structure.
#
# Example RRULE which is now parseable as a string:
#
# EXDATE:19960402T010000Z,19960403T010000Z,19960404T010000Z
@paul
paul / async.rb
Created December 25, 2018 04:05
Implementations of useful step adapters for dry-transaction
# frozen_string_literal: true
module Tesseract
module Transaction
module Steps
# Executes the step in a background job. Argument is either an ActiveJob
# or another Transaction (or anything that implements `#perform_later`.
#
# If the provided transaction implements a `validate` step, then that
# validator will be called on the input before the job is enqueued. This
@petelacey
petelacey / beanstalk_nginx.conf
Last active April 9, 2019 13:45
Nginx always-on SSL config for ElasticBeanstalk
files:
"/etc/nginx/conf.d/000_APP_NAME.conf":
mode: "000755"
owner: root
group: root
content: |
upstream APP_NAME_app {
server unix:///var/run/puma/my_app.sock;
}
@ygotthilf
ygotthilf / jwtRS256.sh
Last active March 23, 2026 01:32
How to generate JWT RS256 key
ssh-keygen -t rsa -b 4096 -m PEM -f jwtRS256.key
# Don't add passphrase
openssl rsa -in jwtRS256.key -pubout -outform PEM -out jwtRS256.key.pub
cat jwtRS256.key
cat jwtRS256.key.pub