Skip to content

Instantly share code, notes, and snippets.

View tonekk's full-sized avatar

Finn Heemeyer tonekk

View GitHub Profile
@tonekk
tonekk / consul_collection.json
Created July 11, 2022 14:32
An insomnia collection for the consul GraphQL api
{
"_type": "export",
"__export_format": 4,
"__export_date": "2022-07-11T14:30:45.103Z",
"__export_source": "insomnia.desktop.app:v2022.4.2",
"resources": [
{
"_id": "req_7526b5b47503457999fdfd5e1d07f72c",
"parentId": "fld_f135b897caf147d5b7baa7d86de80bb0",
"modified": 1657378470902,
#!/bin/sh
curl -s https://raw.githubusercontent.com/thisredone/rb/master/rb > rb
chmod +x rb
sudo mv rb /usr/local/bin
@tonekk
tonekk / keybase.md
Created June 25, 2018 13:25
keybase identity proof

Keybase proof

I hereby claim:

  • I am tonekk on github.
  • I am tonekk (https://keybase.io/tonekk) on keybase.
  • I have a public key ASDq9OnvfGWJe7s_Q0w7AXH1eNbvfS-i6lkiN-mGDzstaAo

To claim this, I am signing this object:

My personal reading list

lifes = 9
puts "Try to kill me, I got #{lifes} lifes!\n"
loop do
begin
sleep 1
rescue Exception => e
lifes = lifes - 1
@tonekk
tonekk / dotfiles setup
Last active May 17, 2021 08:52
script to setup my dotfiles
cd && git clone git@github.com:tonekk/dotfiles.git etc && cd etc && git submodule update --init --recursive && ~/etc/bin/init && nvim -c PlugInstall

Postgres CheatSheet

Create root user

  • Start postgres
  • psql template1
  • CREATE USER root WITH SUPERUSER;

Or

class UrlValidator < ActiveModel::EachValidator
def validate_each(record, attribute, value)
valid = begin
URI.parse(value).kind_of?(URI::HTTP)
rescue URI::InvalidURIError
false
end
unless valid
record.errors[attribute] << (options[:message] || "is an invalid URL")
@tonekk
tonekk / hotfix
Created November 17, 2014 22:59
#!/bin/sh
export GIT_MERGE_AUTOEDIT=no
ruby 'bin/hotfix.rb'
unset GIT_MERGE_AUTOEDIT
@tonekk
tonekk / gist:6107fdf3cd56edb89b19
Created October 16, 2014 06:36
fix_point.h, Beuth
#ifndef FIX_POINT_H
#define FIX_POINT_H
#include <cmath>
/*
* fix_point.h
*
* Finn-Lennart Heemeyer, 791440.Beuth
*/