Skip to content

Instantly share code, notes, and snippets.

View noniq's full-sized avatar

Stefan Daschek noniq

View GitHub Profile
@noniq
noniq / flowdock-archive-to-html.rb
Last active July 1, 2022 11:49
Convert the messages.json file from an exported Flowdock flow into a static HTML page.
#!/usr/bin/env ruby
# Convert an exported Flowdock flow into a static HTML document.
#
# Usage:
#
# flowdock-archive-to-html messages.json > messages.html
#
# The script assumes that there is a subdirectory `files` containing all files referenced in the exported flow. (This is exactly the
# directory structure you get if you unzip an archive downloaded from Flowdock.)
inherit_from: https://raw.githubusercontent.com/die-antwort/style/master/rubocop.yml
AllCops:
Exclude:
- '**/*.erb'
- 'bin/**/*'
- 'db/**/*'
- 'config/initializers/simple_form*.rb'
- 'features/**/*'
- 'lib/file_column/*'
@noniq
noniq / capistrano_rsync.rb
Created August 30, 2017 16:46
Simple plugin for Capistrano 3.7+ to deploy via rsync
require 'capistrano/scm/plugin'
class Capistrano::SCM
# Usage: Add this to your `Capfile`:
#
# require_relative "lib/capistrano_rsync" # adapt path as needed
# install_plugin Capistrano::SCM::Rsync
#
# Note that this you need to deactivate any other SCM plugins (there can only be one SCM plugin active at any time)-
#
@noniq
noniq / gist.rb
Last active September 15, 2022 13:42
Code reloading with Sidekiq and Zeitwerk (if not using Rails)
loader = Zeitwerk::Loader.new
loader.push_dir(__dir__)
if ENV['RACK_ENV'] == 'production'
loader.setup
Zeitwerk::Loader.eager_load_all
else
loader.enable_reloading
loader.setup
Sidekiq.configure_server do |config|
config[:reloader] = ->(&block){ loader.reload; block.call }