Skip to content

Instantly share code, notes, and snippets.

View Glutexo's full-sized avatar
🇨🇿
Wypili moją krew na hejnał

Glutexo Glutexo

🇨🇿
Wypili moją krew na hejnał
  • Frýdek, Czechia
View GitHub Profile
@Glutexo
Glutexo / pohovku.txt
Created June 19, 2020 16:26
Prodáváme pohovku
Prodáváme pohovku. V popisu předmětu je popsaný stav, a lokalita, přiložena fotografie.
První zájemce
– Mohl biste mi.ju nechat prosím do pondělka moc vás prosím na sto procent si ju vezmu dam vám něco navíc
Domluvili jsme se na dni předání. Nedostavil se, nereaguje.
Druhý zájemce
@Glutexo
Glutexo / api.spec.yaml
Last active June 10, 2020 12:13
Insights Host Inventory fixed OpenAPI Schema
openapi: 3.0.0
info:
description: REST interface for the Insights Platform Host Inventory application.
version: 1.0.0
title: Insights Host Inventory REST Interface
paths:
/hosts:
get:
operationId: api.host.get_host_list
tags:
@Glutexo
Glutexo / api.spec.yaml
Created June 10, 2020 10:40
Insights Host Inventory fixed OpenAPI Schema
openapi: 3.0.0
info:
description: REST interface for the Insights Platform Host Inventory application.
version: 1.0.0
title: Insights Host Inventory REST Interface
paths:
/hosts:
get:
operationId: api.host.get_host_list
tags:
@Glutexo
Glutexo / git-rev-history.rb
Last active January 16, 2020 11:26
Get revision history of a git branch
#!/usr/bin/env ruby
# Usage: git-rev-history.rb [branch]
# Output:
# branch@{0} 4be30be6eb844a40ca4af301cb8b2359a5afcd30
# … up to @{9}
#!/usr/bin/env ruby
def command(*args)
@Glutexo
Glutexo / fix-pyenv-shims.rb
Last active September 30, 2019 13:11
Update pyenv shims
#!/usr/bin/env ruby
# Updates path to Python executables in ~/.pyenv/shims. `brew upgrade` breaks
# them. Set the correct versions in the EXPECTED and REPLACED variables below
# and run in ~/.pyenv/shims. WARNING! It replaces the files, not making any
# backups. Use at your own risk!
EXPECTED = <<~EOS.chomp
exec "/usr/local/Cellar/pyenv/1.2.13/libexec/pyenv" exec "$program" "$@"
EOS
@Glutexo
Glutexo / inventory_fix_all.py
Last active July 18, 2019 11:08
Fix all text files in RedHatInsights/insights-host-inventory by a pre-commit hook
from glob import glob
from os.path import join
from pre_commit_hooks.end_of_file_fixer import fix_file
PATTERNS = (
"*.py",
"*.ini",
"README",
@Glutexo
Glutexo / init.el
Created May 10, 2019 08:44
My Emacs init.el file for a pleasant (if possible) usage on macOS
;; Added by Package.el. This must come before configurations of
;; installed packages. Don't delete this line. If you don't want it,
;; just comment it out by adding a semicolon to the start of the line.
;; You may delete these explanatory comments.
(package-initialize)
;; Disable tool bar and menu bar in GUI
(menu-bar-mode 0)
(tool-bar-mode 0)
@Glutexo
Glutexo / pagination-example.md
Last active April 19, 2019 10:44
What is the correct way to build the next and previous links in limit/offset pagination?

10 records

Aligned to begin

?limit=3&offset=0

----------
111        ?limit=3&offset=0
 222 ?limit=3&amp;offset=3
@Glutexo
Glutexo / open-pgadmin-4.rb
Created April 1, 2019 09:52
Open PgAdmin 4
#!/usr/bin/env ruby
=begin
PgAdmin 4 runs on a random port. Once you close its browser window, there
is no way to get back to it. But it stores its address in a hidden file.
This script finds the file and opens the address inside in a default
browser.
=end
path = File::expand_path('~')
@Glutexo
Glutexo / app.py
Last active August 28, 2018 08:51
Kiel consume bug
# This is a simple tornado application that produces to and consumes from a single
# Kafka topic. It works as follows:
# * inputer is fired whenever new data are entered to stdin. Assumes that this
# data is in JSON format. Decodes them and puts them on a local produce_queue.
# * producer connects to Kafka and watches for new items to appear in a local
# produce_queue. Produces those items to Kafka.
# * consumer connects to Kafka and reads messages from it. It does nothing with
# them, just retrieving them to demonstrate the bug.
#
# Usage: