Skip to content

Instantly share code, notes, and snippets.

View kigster's full-sized avatar
:octocat:
Pushing AI automation into production.

Konstantin Gredeskoul kigster

:octocat:
Pushing AI automation into production.
View GitHub Profile
@kigster
kigster / datadog.rb
Created February 21, 2020 22:18
Datadog Rails Configuration
# config/initializers/datadog.rb
require 'ddtrace'
require 'redis'
Datadog::Tracer.log = Logger.new(nil)
# This is the port we have configured in the /etc/datadog/datadog.yml (apm_config)
Datadog.tracer.configure(port: 9126, enabled: true)
# TODO: change me
@kigster
kigster / ruby-jemalloc-check.sh
Last active August 12, 2022 19:41
Detect if MRI Ruby is built with jemalloc library or not, download with `curl -fSL http://bit.ly/ruby-jemalloc-check > ruby-jemalloc-check.sh`
#!/usr/bin/env bash
# vi: ft=sh
#
# https://gist.github.com/kigster/8ddebf9fddff25620e64d558dd4d56b7
#
# © 2019-2022 Konstantin Gredeskoul, Inc., All rights reserved.
# MIT LICENSE
# ————————————————————————————————————————————————————————————————
# This script verifies that the ruby interpreter (either the one in
# the $PATH, or the one specified by the -r / --ruby option) is linked
@kigster
kigster / shell-set.sh
Created December 24, 2019 22:01
BASH functions to read values of set -e, -x, etc and be able to save them, and restore them later, eg. at the end of a function that wants to handle its errors.
#!/usr/bin/env bash
# ———————————————————————————————————————————————————————
# BashMatic Utilities Library
# ———————————————————————————————————————————————————————
# © 2017-2020 Konstantin Gredeskoul, All rights reserved.
#
# Distributed under the MIT LICENSE.
#
# Sources: https://github.com/kigster/bashmatic
# ———————————————————————————————————————————————————————
@kigster
kigster / bootstrap-bashmatic.sh
Last active December 18, 2019 09:49
BashMatic bootstrapper for curl-based installations. To install BashMatic using this, run the following command: `eval "$(curl -fsSL http://bit.ly/bashmatic-v0-1-0)"`
#!/usr/bin/env bash
# vim: ft=sh
[[ -z $(command -v git) ]] && {
echo "Please install xcode-tools on MacOSX, or git on Linux before running this script."
exit 1
}
export BashMatic="${HOME}/.bashmatic"
@kigster
kigster / cloudSettings
Last active August 5, 2020 04:50
VSCode Settings Sync
{"lastUpload":"2020-08-05T04:50:18.785Z","extensionVersion":"v3.4.3"}
@kigster
kigster / ruby-with-bazel.md
Created November 26, 2019 22:05
RubyConf Australia Submission for 2020

Building Ruby Apps and Gems with Bazel and Monorepo

Elevator Pitch

You must have heard about mono-repos by now. It's all the rage. Google is doing it, AirBnB is doing it, — the list goes on. But: does it really make sense to put all of your Ruby Things in one basket? Even so, does Bazel build system deliver on its promises when applied to Ruby? Come and see!

Talk Format

30-45 minutes

@kigster
kigster / jb
Last active October 28, 2019 22:56
JetBrains Command Line IDE Finder / Launcher. This tool should be installed in /usr/local/bin/jb and then, as long as your JetBrains apps are installed into `/Applications/apps` folder, `jb` will be able to find launch them. If the binaries are installed elsewhere, set the `JETBRAINS_INSTALLATION_DIR` folder.
#!/usr/bin/env bash
#
# © 2019 Konstantin Gredeskoul
#
# A generic jetbrains command line launcher after the Toolbox one seems to
# never really work anymore.
#
# This tool should be installed in /usr/local/bin/jb and then, as long as your JetBrains apps
# are installed into `/Applications/apps` folder, `jb` will be able to find launch them.
# If the binaries are installed elsewhere, set the `JETBRAINS_INSTALLATION_DIR` folder.
@kigster
kigster / sha1benchmark.rb
Last active August 17, 2019 00:04
Comparing time to compute SHA1 of integers using pure Ruby, Ruby threads, and Forking
#!/usr/bin/env ruby
#
# To run this example, do first: `gem install parallel`
#
# Simple Benchmark on a 16-Core MacBook PRO:
#
# Number of CPU Cores: 16, total iterations: 10000
#
# user system total real
# ruby/01T 0.054921 0.000947 0.055868 ( 0.055886)
@kigster
kigster / .irbrc
Created July 3, 2019 22:05
My ~/.irbrc that loads some extra goodies
# encoding: utf-8
require 'readline'
require 'irb/completion'
require 'irb/ext/save-history'
begin
require 'colored2'
require 'awesome_print'
require 'irbtools'
rescue LoadError => e
@kigster
kigster / fabfilter-remover.sh
Created March 5, 2019 05:16
Script to find and remove FabFilter plugins on Mac OS-X. Requires Terminal usage.
#!/usr/bin/env bash
if [[ ! -L lib || ! -L bootstrap ]]; then
[[ -z $(which curl) ]] && {
printf "Curl is required for this operation. Please install it with\n"
printf "brew install curl\n"
exit 1
}
curl -fsSL "http://bit.ly/bashmatic-bootstrap" | /usr/bin/env bash
fi