This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ActiveRecord::Base.logger = Logger.new(STDOUT) | |
ActiveRecord::Base.logger.level = Logger::DEBUG | |
ActiveRecord::LogSubscriber::IGNORE_PAYLOAD_NAMES.clear |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# Usage: ./torloop <command> | |
# | |
# Runs a command over and over again with | |
# a new tor identity each time. | |
# | |
# The command should use the tor network | |
# under socks5 proxy on port 9050. | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# frozen_string_literal: true | |
require "bundler/inline" | |
gemfile(true, quiet: 1) do | |
source "https://rubygems.org" | |
gem "editorconfig" | |
end | |
require "json" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ``` | |
// sequenceKeyBinding('hello', () => { console.log('world') }) | |
// ``` | |
const sequenceKeyBinding = (seq, action, timeoutMs=3000) => { | |
let curr = 0 | |
let timeout = null | |
document.body.addEventListener('keydown', (e) => { | |
if (seq[curr] == e.key) { | |
if (!timeout) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// See also https://silverhammermba.github.io/emberb/embed/ | |
ruby-gcc-flags() { | |
[[ "$(rbenv version)" = "system" ]] && return 1 | |
PKG_CONFIG_PATH="$PKG_CONFIG_PATH:$(rbenv prefix)/lib/pkgconfig" \ | |
pkg-config --cflags --libs ruby-$(rbenv version | cut -d. -f1-2) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0"?> | |
<opml version="1.0"> | |
<head> | |
<title>Feeds from Stringer</title> | |
</head> | |
<body> | |
<outline text="Without boats, dreams dry up" title="Without boats, dreams dry up" type="rss" xmlUrl="https://without.boats/index.xml"/> | |
<outline text="Vanguard Consulting Ltd" title="Vanguard Consulting Ltd" type="rss" xmlUrl="https://beyondcommandandcontrol.com/feed/"/> | |
<outline text="Paul Ramsey" title="Paul Ramsey" type="rss" xmlUrl="http://blog.cleverelephant.ca/atom.xml"/> | |
<outline text="Tags from geos" title="Tags from geos" type="rss" xmlUrl="https://github.com/libgeos/geos/releases.atom"/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>REDIS Commands By ACL Category</title> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function clone { | |
local all user repo | |
(( $# != 1 )) && echo "usage: clone <url>" && return 1 | |
all="$1" | |
all="${all#'https://github.com/'}" | |
all="${all#'git@github.com:'}" | |
all="${all%'.git'}" | |
IFS='/' read -r user repo <<< "$all" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# @param job_name [nil | #call | Regexp | String] name or proc to filter on | |
# @param tally_by [Symbol | #call] either a Sidekiq::SortedEntry method or a | |
# thing that responds to #call and takes the entry as argument | |
# @return the filtered jobs | |
# @example | |
# sidekiq_stat("ApplyReferrals.call", ->(j) { j.item["error_message"].gsub(/\w{8}-\w{4}-\w{4}-\w{4}-\w{12}/, "UUID") }) | |
def sidekiq_stat(job_name = nil, tally_by = :display_class) | |
jobs = Sidekiq::DeadSet.new.select do |sorted_entry| | |
case job_name | |
when nil then true |
NewerOlder