Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env bash
DATABASE_URL="postgres://MyPostgresUser:MyPostgresPassword@192.168.0.1:5432/MyPostgresDB"
# `cut` is used to cut out the separators (:, @, /) that come matched with the groups.
DATABASE_USER=$(echo $DATABASE_URL | grep -oP "postgres://\K(.+?):" | cut -d: -f1)
DATABASE_PASSWORD=$(echo $DATABASE_URL | grep -oP "postgres://.*:\K(.+?)@" | cut -d@ -f1)
DATABASE_HOST=$(echo $DATABASE_URL | grep -oP "postgres://.*@\K(.+?):" | cut -d: -f1)
DATABASE_PORT=$(echo $DATABASE_URL | grep -oP "postgres://.*@.*:\K(\d+)/" | cut -d/ -f1)

In November, I realized some Core BTC devs don't understand the LN. Other influencers agreed with me, some in private, some publicly. These questions arose from that confusion, in an attempt to clear things up once and for all.


  1. If Alice and Bob want to transact, they need to open a channel, and they need to agree on max amount to transfer through that channel. This requires a transaction. To finalize the transaction so they can spend the BTC outside of their channel, they need to close it so their on-chain balance updates and so they can send BTC onward into other channels. Closing also needs a tx. How, then, is it sensible for Alice and Bob to transact this way, instead of what they can do now - use one single transaction?

  2. A common argument against the above is "you'll have middlemen through which many channels will go and form a mesh". My question is twofold:

  • a) how is it that this does not scare you? If LN becomes super popular and
@DirkWolke
DirkWolke / searchbox.html
Created October 14, 2016 12:34
#TYPO3 #FLUID searchbox-form for #indexed_search
<f:form class="searchbox form-inline"
pageUid="{pidSearch}"
method="post"
noCacheHash="true"
absolute="0"
action="search"
extensionName="IndexedSearch"
pluginName="pi2"
controller="Search"
>
@liverbool
liverbool / bootstrap_4_layout.html.twig
Created March 22, 2016 09:32
bootstrap_4_layout.html.twig
{% use "form_div_layout.html.twig" %}
{# Widgets #}
{% block form_widget_simple -%}
{% if type is not defined or 'file' != type %}
{%- set attr = attr|merge({class: (attr.class|default('') ~ ' form-control')|trim}) -%}
{% endif %}
{{- parent() -}}
{%- endblock form_widget_simple %}
@smichaelsen
smichaelsen / Favicons.html
Last active October 12, 2023 17:52
Multiple Favicons in TypoScript
<html data-namespace-typo3-fluid="true" xmlns:f="http://typo3.org/ns/TYPO3/Fluid/ViewHelpers">
<link rel="apple-touch-icon" sizes="57x57" href="{f:uri.resource(path:'Favicons/apple-touch-icon-57x57.png')}">
<link rel="apple-touch-icon" sizes="60x60" href="{f:uri.resource(path:'Favicons/apple-touch-icon-60x60.png')}">
<link rel="apple-touch-icon" sizes="72x72" href="{f:uri.resource(path:'Favicons/apple-touch-icon-72x72.png')}">
<link rel="apple-touch-icon" sizes="76x76" href="{f:uri.resource(path:'Favicons/apple-touch-icon-76x76.png')}">
<link rel="apple-touch-icon" sizes="114x114" href="{f:uri.resource(path:'Favicons/apple-touch-icon-114x114.png')}">
<link rel="apple-touch-icon" sizes="120x120" href="{f:uri.resource(path:'Favicons/apple-touch-icon-120x120.png')}">
<link rel="apple-touch-icon" sizes="144x144" href="{f:uri.resource(path:'Favicons/apple-touch-icon-144x144.png')}">
<link rel="apple-touch-icon" sizes="152x152" href="{f:uri.resource(path:'Favicons/apple-touch-icon-152x152.png')}">
@liayn
liayn / gist:b09fa61878244f273493
Created June 8, 2015 17:25
Create Fake FE in TYPO3 Backend for proper FE link generation from BE
<?php
class Foo {
protected function buildFakeFE($pageUid) {
// clear session key to avoid FE cookies
$oldGETSessionKey = '';
if (isset($GLOBALS['_GET']['FE_SESSION_KEY'])) {
$oldGETSessionKey = $GLOBALS['_GET']['FE_SESSION_KEY'];
}
$oldPOSTSessionKey = '';
if (isset($GLOBALS['_POST']['FE_SESSION_KEY'])) {
@irazasyed
irazasyed / manage-etc-hosts.sh
Created March 7, 2015 09:16
Bash Script to Manage /etc/hosts file for adding/removing hostnames.
#!/bin/sh
# PATH TO YOUR HOSTS FILE
ETC_HOSTS=/etc/hosts
# DEFAULT IP FOR HOSTNAME
IP="127.0.0.1"
# Hostname to add/remove.
HOSTNAME=$1
@cedricziel
cedricziel / README.md
Last active October 27, 2021 08:12
TYPO3 Extension with 3rd part composer dependencies. composer.json is placed in Resources/Private - Updated

Motivation

As long as composer support in CMS is "not there yet", you need to get around somehow.

Say you want to use the (awesome) markdown library, you need a way to get it in.

How

  1. Use a container extension with a private namespace
@albertbori
albertbori / Installation.md
Last active July 15, 2024 15:33
Automatically disable Wifi when an Ethernet connection (cable) is plugged in on a Mac

Overview

This is a bash script that will automatically turn your wifi off if you connect your computer to an ethernet connection and turn wifi back on when you unplug your ethernet cable/adapter. If you decide to turn wifi on for whatever reason, it will remember that choice. This was improvised from this mac hint to work with Yosemite, and without hard-coding the adapter names. It's supposed to support growl, but I didn't check that part. I did, however, add OSX notification center support. Feel free to fork and fix any issues you encounter.

Most the credit for these changes go to Dave Holland.

Requirements

  • Mac OSX 10+
  • Administrator privileges
@benjaminrau
benjaminrau / PagePartials.html
Created August 25, 2014 07:19
This section defines all metatags which are used to have defined in a website. It also contains the most relevant OG-Tags for facebook. It can also be used as an example how to read FAL images related to a page record. Here it is used as og:image
<div xmlns:v="http://typo3.org/ns/FluidTYPO3/Vhs/ViewHelpers"
xmlns:f="http://typo3.org/ns/fluid/ViewHelpers">
<f:section name="MetaTags">
{v:resource.record.fal(record: page, field: 'media', table: 'pages') -> v:iterator.extract(key: 'uid') -> v:iterator.first() -> v:var.set(name: 'pageMedia')}
<v:page.header.meta name="keywords" content="{page.keywords}" />
<v:page.header.meta name="description" content="{page.description}" />
<v:page.header.meta name="og:title" content="{page.title}" />
<v:page.header.meta name="og:type" content="article" />
<v:page.header.meta name="og:url" content="{v:page.absoluteUrl()}" />