Skip to content

Instantly share code, notes, and snippets.

View schovi's full-sized avatar
👁️

David Schovanec schovi

👁️
View GitHub Profile
@schovi
schovi / sidekiq.rb
Created March 17, 2017 22:38
Configure sidekiq via ENV variables
Sidekiq.configure_server do |config|
ENV["SIDEKIQ_NAMESPACE"] && config.options[:namespace] = ENV["SIDEKIQ_NAMESPACE"]
ENV["SIDEKIQ_CONCURRENCY"] && config.options[:concurrency] = ENV["SIDEKIQ_CONCURRENCY"].to_i
ENV["SIDEKIQ_VERBOSE"] && config.options[:verbose] = ENV["SIDEKIQ_VERBOSE"] === 'true'
ENV["SIDEKIQ_LOGFILE"] && config.options[:logfile] = ENV["SIDEKIQ_LOGFILE"]
ENV["SIDEKIQ_PIDFILE"] && config.options[:pidfile] = ENV["SIDEKIQ_PIDFILE"]
config.options[:strict] = true
if ENV["SIDEKIQ_QUEUES"]
@schovi
schovi / OSX cleanup.md
Last active February 8, 2024 01:58
My collection of resources how to keep your mac fresh, fast and with lot of disk space. Still **WORK IN PROGRESS**. If you have any comments and tips, give me comment. Like how to clean after python, clojure, etc etc
@schovi
schovi / brightness.js
Last active October 27, 2023 19:49
Small scripts to boost twitch volume beyond 100% or change brightness of video
// To use this, open console (developer tools), change the brigtness you want, paste it there and run
// 1 = 100% ...
twitchBrightness(1.2)
function twitchBrightness(amount) {
const video = document.querySelector('video')
video.style.filter = `brightness(${amount * 100}%)`
}
/usr/local/bundle/ruby/3.1.0/gems/ruby-kafka-1.5.0/lib/kafka/async_producer.rb:162:in `block (2 levels) in ensure_threads_running!'
/usr/local/bundle/ruby/3.1.0/gems/ruby-kafka-1.5.0/lib/kafka/async_producer.rb:215:in `run'
/usr/local/bundle/ruby/3.1.0/gems/ruby-kafka-1.5.0/lib/kafka/async_producer.rb:227:in `do_loop'
/usr/local/bundle/ruby/3.1.0/gems/ruby-kafka-1.5.0/lib/kafka/async_producer.rb:227:in `loop'
/usr/local/bundle/ruby/3.1.0/gems/ruby-kafka-1.5.0/lib/kafka/async_producer.rb:236:in `block in do_loop'
/usr/local/bundle/ruby/3.1.0/gems/ruby-kafka-1.5.0/lib/kafka/async_producer.rb:284:in `deliver_messages'
/usr/local/bundle/ruby/3.1.0/gems/ruby-kafka-1.5.0/lib/kafka/producer.rb:254:in `deliver_messages'
/usr/local/bundle/ruby/3.1.0/gems/ruby-kafka-1.5.0/lib/kafka/instrumenter.rb:21:in `instrument'
/usr/local/bundle/ruby/3.1.0/gems/ruby-kafka-1.5.0/lib/kafka/producer.rb:261:in `block in deliver_messages'
/usr/local/bundle/ruby/3.1.0/gems/ruby-kafka-1.5.0/lib/kafka/producer.rb:398:in `deliver_messages_
# frozen_string_literal: true
require "graphql/schema/mutation"
require "graphql/types/string"
module GraphQL
class Schema
# Mutations that extend this base class get some conventions added for free:
#
# - An argument called `clientMutationId` is _always_ added, but it's not passed
# to the resolve method. The value is re-inserted to the response. (It's for
tap 'homebrew/cask'
tap 'homebrew/cask-fonts'
tap 'homebrew/cask-versions'
tap 'clementtsang/bottom' # https://github.com/clementtsang/bottom#homebrew
tap 'brona/iproute2mac'
# tap 'thoughtbot/formulae' # https://github.com/thoughtbot/parity
#################
## Cask applications
cask_args appdir: '/Applications'
tap 'homebrew/cask'
tap 'homebrew/cask-fonts'
tap 'homebrew/cask-versions'
tap 'clementtsang/bottom' # https://github.com/clementtsang/bottom#homebrew
tap 'brona/iproute2mac'
# tap 'thoughtbot/formulae' # https://github.com/thoughtbot/parity
#################
## Cask applications
cask_args appdir: '/Applications'
6919598227838199913855119231126554696792992136695118448313191841922775524417825151216891429923213541
9837948917619787189935571922197132977185355128371858691255934311214863828372926993213996998139912118
9712819911516295249274925911896922213911165843181262181868447395254293349493421938929117229988638933
2476951876931175825312533142569137931721739713725799446851119715122115753938166842994429692731365577
3691396937919199853599315812613951281125263711868971256541511653441136543245312424117567151668999674
9294972854229491498411271321351998983919929272128753711198282397882539157287554149474186951291188213
1135428214811459993621216218435832221856114139399136248687314682119118892393618575918692412341569411
2929921158912711182518311271272489732271565129299979967487113812154971756485549913921162939114391994
5735115881479239217981525718898929221191614222551693914913779439617933359521941311111857328992347824
1324749414111313198724813856727141934339899617632138746132396173529281922347716643138211113979119317
module PluckInBatches
extend ActiveSupport::Concern
ID_COLUMN = "id"
class_methods do
def pluck_each(*columns, batch: 1000, limit: _pluck_each_scope_limit, &block)
raise "Block must be provided" unless block
columns = columns.flatten.map(&:to_s)
@schovi
schovi / .phoenix.js
Last active February 2, 2020 19:32
Phoenix configuration similar to Magnet app https://github.com/kasper/phoenix (WIP, missing some keybinds implementation)
// Preferences
Phoenix.set({
daemon: true,
openAtLogin: true,
});
const COMMAND = 'command'
const CONTROL = 'control'
const OPTION = 'option'
const SHIFT = 'shift'