Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing

Konstantin Gredeskoul kigster

🎯
Focusing
Block or report user

Report or block kigster

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@kigster
kigster / build-intellij-bazel.sh
Last active Mar 22, 2020
Basic build helper script for building IntelliJ Plugin from sources. See http://bit.ly/intellij-bazel-plugin-from-sources for more info.
View build-intellij-bazel.sh
#!/usr/bin/env bash
set -ex
function intellij::build() {
local intellij_product="$1" # eg, "intellij-ue-2019.3"
local shortcut=$(echo ${intellij_product} | sed 's/-.*$//g')
local plugin_base=
case $shortcut in
intellij)
@kigster
kigster / bazel-intellij-exception.md
Last active Mar 2, 2020
IntelliJ IDEA Ultimate 2019.3.3 + Bazel Plugin — Import Project exception: No SyncPlugin present which provides a default workspace type.
View bazel-intellij-exception.md

Bazel Plugin Exception when Importing a Project

Steps Involved

  1. Install Plugin (tried two methods, same result — see below)
  2. Restart IDEA
  3. Select Import Bazel Project
  4. Point "workspace" to the folder with the WORKSPACE file.
  5. When asked to create project build file, I tried "create from scratch" and "import from BUILD file" — same result.
  6. I can't seem to move past this stage, and I don't see any other method to enable Bazel support for a project.
@kigster
kigster / datadog.rb
Created Feb 21, 2020
Datadog Rails Configuration
View datadog.rb
# 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 Jan 8, 2020
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`
View ruby-jemalloc-check.sh
#!/usr/bin/env bash
# vi: ft=sh
#
# © 2019 Konstantin Gredeskoul, Inc., All rights reserved.
# MIT LICENSE
#
# ————————————————————————————————————————————————————————————————
# This script verifies that the current ruby (in PATH) is linked
# with libjemalloc library for efficient memory utilization.
# It works identically on Linux and Mac OSX.
@kigster
kigster / shell-set.sh
Created Dec 24, 2019
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.
View shell-set.sh
#!/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 Dec 18, 2019
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)"`
View bootstrap-bashmatic.sh
#!/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 Apr 7, 2020
VSCode Settings Sync
View cloudSettings
{"lastUpload":"2020-04-07T21:50:52.309Z","extensionVersion":"v3.4.3"}
@kigster
kigster / ruby-with-bazel.md
Created Nov 26, 2019
RubyConf Australia Submission for 2020
View ruby-with-bazel.md

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 Oct 28, 2019
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.
View jb
#!/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 Aug 17, 2019
Comparing time to compute SHA1 of integers using pure Ruby, Ruby threads, and Forking
View sha1benchmark.rb
#!/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)
You can’t perform that action at this time.