Skip to content

Instantly share code, notes, and snippets.

View benregn's full-sized avatar

Tomas Thor Jonsson benregn

View GitHub Profile
@benregn
benregn / sentry_live_view_hook_live_render.exs
Last active June 15, 2024 18:27
Bug reproduction for Elixir Sentry LiveViewHook
Application.put_env(:sample, Example.Endpoint,
http: [ip: {127, 0, 0, 1}, port: 5001],
server: true,
live_view: [signing_salt: "aaaaaaaa"],
secret_key_base: String.duplicate("a", 64)
)
Mix.install([
{:plug_cowboy, "~> 2.5"},
{:jason, "~> 1.0"},
@benregn
benregn / cloudSettings
Last active February 3, 2021 12:14
Visual Studio Code Settings Sync Gist
{"lastUpload":"2021-02-03T12:14:03.986Z","extensionVersion":"v3.4.3"}
@benregn
benregn / debug_postgres_locks.md
Created May 9, 2019 15:11
Debugging stuck queries in postgres (lock)
### Keybase proof
I hereby claim:
* I am benregn on github.
* I am benregn (https://keybase.io/benregn) on keybase.
* I have a public key whose fingerprint is 635E 9ACE AB30 62CE 0D12 C42E CB9C 5EFF 38D5 E798
To claim this, I am signing this object:

Use dig hostname to check DNS issues

dig redis-host.something.

Look for the presence or absence of the ;; ANSWER SECTION:

Use nping from nmap package to check connection issues

nping -p 6379 redis-host.something.
import json
from collections import defaultdict
import requests
token = '<github-access-token>'
gh_url = 'https://api.github.com'
headers = {'Authorization': 'token {}'.format(token)}

Requirements

  • Docker Machine + Docker
  • curl
  • A Virtualbox-driven Docker Machine called "default" docker-machine create --driver virtualbox default (this is the default with Docker toolkit).

Usage

The git.io URL (https://git.io/vzaSg) is a shortened form of the raw url of the plist.

@benregn
benregn / bump.sh
Created April 21, 2015 13:18
Bump project version when version is stored in VERSION
is-executable() {
local BIN=`command -v "$1" 2>/dev/null`
if [[ ! $BIN == "" && -x $BIN ]]; then
return 0
else
return 1
fi
}
# a wrapper for versionbump
@benregn
benregn / bdk.js
Created April 6, 2015 12:15
Extract waiting list numbers from bdk.dk
// https://www.bdk.dk/min-profil/mine-opskrivninger.aspx
var csv = [['Company name', 'Apartment section', 'Number of rooms', 'Active number', 'Passive number']];
$('#basketAccordion .panel-default').each(function (index, panel) {
var $panel = $(panel);
var apartmentCompanyName = $.trim($panel.find('.panel-title').text());
console.log('---' + apartmentCompanyName + '---');
$panel.find('.panel-body').each(function (index, panelBody) {
$(panelBody).children().each(function (index, apartmentSection) {
var $apartmentSection = $(apartmentSection);
@benregn
benregn / proof.md
Created April 2, 2015 14:05
keybase.io

Keybase proof

I hereby claim:

  • I am benregn on github.
  • I am benregn (https://keybase.io/benregn) on keybase.
  • I have a public key whose fingerprint is 0D4F F338 0C88 7158 9531 B19F 431B 09EB F2B6 430A

To claim this, I am signing this object: