Skip to content

Instantly share code, notes, and snippets.

@odayvhl
odayvhl / clear-sidekiq-jobs.sh
Created July 23, 2019 20:02 — forked from wbotelhos/clear-sidekiq-jobs.sh
Clear Sidekiq Jobs
# 1. Clear retry set
Sidekiq::RetrySet.new.clear
# 2. Clear scheduled jobs
Sidekiq::ScheduledSet.new.clear
# 3. Clear 'Processed' and 'Failed' jobs
@odayvhl
odayvhl / cant-install-rmagick-2-13-1-cant-find-magickwand-h.md
Created July 23, 2019 18:12 — forked from ntamvl/cant-install-rmagick-2-13-1-cant-find-magickwand-h.md
[Resolved In Mac OSX Sierra] Can't install RMagick 2.13.1. Can't find MagickWand.h.

[Resolved] Can't install RMagick 2.13.1. Can't find MagickWand.h

In Mac OSX Sierra, to solve the issue, I had to do the following:

Clean:

brew uninstall imagemagick
brew unlink imagemagick

Then install:

require 'csv'
require 'time'
CSV_FILE = ARGV[0]
CUTOFF = 2015
abandoned = []
variance = []
table = CSV.read(CSV_FILE)
table.each_with_index do |row, i|
@odayvhl
odayvhl / DO_NOT_RUN_sketchy.js
Last active May 29, 2019 18:21
lapuso.ru/chk_ya2
(function(n, q, w) {
function E(a, b, d) {
return function() {
try {
return a.apply(this, arguments)
} catch (e) {
d || Wa(e, b)
}
}
}
@odayvhl
odayvhl / bcrypt_cost_test.rb
Created March 12, 2019 16:09
Test the time for each cost from 10 to 20 in bcrypt
require 'bcrypt'
require 'time'
puts "cost: 10"
start_time = Time.now
password = BCrypt::Password.create("Password", :cost=>10)
end_time = Time.now
puts "time: #{end_time - start_time}"
puts "cost: 11"

tmux/tmuxinator cheatsheet

tmux

As configured in my dotfiles, here and here.

Command line

$ tmux                           -> start new
$ tmux new -s myname             -> start new w/session name
$ tmux a  #  (or at, or attach)  -> attach
$ tmux a -t myname               -> attach to named
#!/usr/bin/env python
#
# Simplistic RDS logfile downloader because AWS CLI + Botocore is broken. :-(
#
from __future__ import print_function
import argparse
import os.path
import sys