Skip to content

Instantly share code, notes, and snippets.

View fjahr's full-sized avatar
🏠
Working from home

Fabian Jahr fjahr

🏠
Working from home
View GitHub Profile

Keybase proof

I hereby claim:

  • I am fjahr on github.
  • I am fjahr (https://keybase.io/fjahr) on keybase.
  • I have a public key whose fingerprint is CC3E 7047 449F B0CF AF2E E759 445A AC9B B405 55D1

To claim this, I am signing this object:

How to use React-intl with PhraseApp

1. Keep your messages in a separate JSON file.

You can use nesting for React-intl v1 or omit it to comply with v2.

en-US.json

{
 'hello_world': 'Hello World'
@fjahr
fjahr / application.html.erb
Last active October 4, 2021 10:35 — forked from suryart/application.html.erb
Displaying Rails 5 flash messages with Twitter Bootstrap 4 (last tested on Alpha-v6). Updated version of https://gist.github.com/suryart/7418454
// layout file
<body>
<div class="container">
<%= flash_messages %>
<%= yield %>
</div><!-- /container -->
</body>
@fjahr
fjahr / .cVimrc
Created March 29, 2017 23:24
cVimrc
let blacklists = ["https://mail.google.com/*", "*://mail.google.com/*", "@https://mail.google.com/mail/*"]
Verifying my Blockstack ID is secured with the address 1DMWKLoHuFQU5QHAa2KyQwEqsyLP5sxXLN https://explorer.blockstack.org/address/1DMWKLoHuFQU5QHAa2KyQwEqsyLP5sxXLN
@fjahr
fjahr / pb.py
Last active April 20, 2018 15:48
Minimize Change Output for Bitcoin transactions, naive implementation
"""
Suppose you are given a list of possible Bitcoin that you control (inputs). You
need to pay someone exactly 0.71 BTC. How would you select exactly 2 inputs in
such a way as to minimize the change output if you could ignore fees? Write a
python function that selects the two inputs.
"""
from itertools import permutations
TEST_INPUTS = [0.21, 0.59, 1.34, 3.45, 0.3, 0.84, 0.53, 0.62, 0.70, 0.21, 0.44,
0.28, 0.39, 200.9, 4.34]
@fjahr
fjahr / debug.ex
Created April 24, 2018 23:07
Debugging Plug as a last resort for debugging nasty production issue in Elixir/Phoenix/AWS ECS Fargate
defmodule MyApp.Plugs.Debug do
@behaviour Plug
require Logger
def init(default), do: default
def call(conn, _) do
case conn.request_path do
"/path/to/error" ->
@fjahr
fjahr / lightning_resources.md
Last active November 14, 2018 23:37
Technical Lightning Network Resources
@fjahr
fjahr / lightning_messages.md
Last active February 2, 2019 20:22
List of all Lightning Network Message Types

Lightning Network Message Types

List of all Lightning Network Message Types for easy & quick overview.

Setup & Control (0 - 31)

Messages related to connection setup, control, supported features, and error reporting.

@fjahr
fjahr / lightning_mw_messages.md
Last active February 11, 2019 17:28
List of all Lightning Network MW Message Types

Lightning Network MW Message Types

List of all Lightning Network Message Types for easy & quick overview.

Messages with strikethrough style exist in the original RFCs but are currently removed in Lightning MW.

Setup & Control (0 - 31)

Messages related to connection setup, control, supported features, and error reporting.