Skip to content

Instantly share code, notes, and snippets.

View fiatjaf's full-sized avatar

fiatjaf_ fiatjaf

View GitHub Profile
@fiatjaf
fiatjaf / christmas2009.md
Created December 24, 2019 22:41
Mensagem de Natal 2009, Olavo de Carvalho

Christmas 2009

Musically, some prefer Tristan and Isolde, but in the matter of dramatic power and richness of meaning, Wotan’s final aria in The Valkyrie, “Leb Wohl” (Farewell), is doubtless the pinnacle of Richard Wagner’s work. What does that have to do with Christmas? Hold on a while, and let me recall the scene.

Pressured by his wife Fricka, who urges him to fulfill his duties as maintainer of the cosmic order, Wotan, the Germanic counterpart of Zeus, unwillingly promises to punish by death his grandson Siegmund—guilty of adultery and incest with his sister Sieglinde. To achieve this goal, Wotan sends his dearest daughter, Brünnhilde, to the place where Sieglinde’s husband will fight a duel with Siegmund, to ensure that Siegmund, deprived of all divine assistance, is killed in the duel. At the decisive moment, Brünnhilde allows herself to be overcome with compassion for Siegmund, and disobeying the order she received, attempts to protect him. Wotan has to intervene personally, breaking Si

@fiatjaf
fiatjaf / flask-lnurl.py
Last active December 26, 2019 22:37
lnurl snippets
import hashlib
import json
from flask import Flask, jsonify, request
app = Flask(__name__)
BASE_URL = 'https://myservice.com'
@app.route('/lnurl-one')
def lnurl_one():
return jsonify({
@fiatjaf
fiatjaf / .gitignore
Last active August 13, 2022 07:35
hsm_secret and custom invoices with lnurl on c-lightning
venv
*.swo
*.swp
__pycache__
@fiatjaf
fiatjaf / README.md
Last active April 27, 2019 03:23
etleneum htlc contract

A contract that can handle multiple "HTLCs" -- in the sense that these are just values parked at the contract that can be claimed by anyone with the correct preimage during some time. After the expiration time they can then be claimed by another different preimage.


Interface


  • method: open
export const providers = {
alias: {
desc: 'Alias for a existing remote',
options: [
{
name: 'remote',
desc:
'Remote or path to alias.\nCan be "myremote:path/to/dir", "myremote:bucket", "myremote:" or "/local/path".',
required: true
}
@fiatjaf
fiatjaf / aposta.txt
Last active August 8, 2019 03:01
aposta
31/12/2022
1. homicídios por ano
2. mulheres mortas pelos companheiros
3. fim do foro privilegiado
4. desemprego
5. pib
6. inflação
7. taxa de desmatamento
8. estupros
@fiatjaf
fiatjaf / check_sig.go
Last active March 24, 2023 08:36 — forked from lsowen/check_sig.go
GPG signature verification in Go with a bunch of strings
package main [33/492]
import (
"fmt"
"strings"
"golang.org/x/crypto/openpgp"
)
func main() {
@fiatjaf
fiatjaf / dl.css
Created August 29, 2017 01:30
basic CSS for useful description lists
dt {
font-weight: bold;
float: left;
min-width: 200px;
text-align: right;
}
dt:after {
content: ':';
margin-right: 10px;
@fiatjaf
fiatjaf / main.js
Last active November 10, 2023 01:16
idea of a framework that takes the best of Cycle, React and Mobx
window.xtend = require('xtend')
const {h, run, reactive, track, select} = require('.')
var state = reactive({
name: select('.name-type')
.events('change')
.map(e => e.target.value),
desc: select('.desc-type')
.events('change')
.map(e => e.target.value)
@fiatjaf
fiatjaf / README.md
Created October 12, 2016 22:21
simple raw webrtc data connection between two peers with a super-small websocket server

TO RUN

  1. Modify app.js to use the address of your websocket server instead of ws://ws-server:8088.
  2. Run the websocket server: node ws-server.js
  3. Run an HTTP static file server of your choice: python3 -m http.server 8080
  4. Visit index.html or your HTTP static file server root. Do this on 2 different computers or 2 tabs on the same computer.
  5. The screen is blank. Open the Javascript console and set values for me and other. Do the same on the other computer/tab (but inverting the values this time). Then call connect. After the connection is established you'll be able to call channel.send('message') and see the event logs at the other computer/tab.