Skip to content

Instantly share code, notes, and snippets.

@mabenson00
mabenson00 / cheatsheet.rb
Last active April 18, 2025 17:46
Rails Postgres ActiveRecord JSON cheatsheet
# Basic key operators to query the JSON objects :
# #> : Get the JSON object at that path (if you need to do something fancy)
# -> : Get the JSON object at that path (if you don't)
# ->> : Get the JSON object at that path as text
# {obj, n} : Get the nth item in that object
# https://www.postgresql.org/docs/9.4/functions-json.html#FUNCTIONS-JSONB-OP-TABLE
# Date
# date before today
@0xtav
0xtav / list-of-neutrino-nodes.md
Created September 3, 2022 01:37
List of neutrino nodes.

List of neutrino nodes.

Neutrino is a lightweight bitcoin client, which allows the use of the bitcoin network without the need to run a full node, for those who don't want to wait hours or even days to use LND this can be an alternative, below is a list of nodes you can connect to.

  • mainnet1-btcd.zaphq.io
  • btcd-mainnet.lightning.computer
  • mainnet1-btcd.zaphq.io
  • mainnet2-btcd.zaphq.io
  • mainnet3-btcd.zaphq.io
  • mainnet4-btcd.zaphq.io
@zerofeerouting
zerofeerouting / channel-opening-service.md
Last active June 24, 2023 22:39
zero fee routing - channel opening service

Channel opening service

I will open a channel to you with my on-chain funds for a fee.

https://zerofeerouting.com

If you have any questions, please reach out to me via Twitter or telegram. I rarely look in the comments of this gist.

How much is a channel?

The price for the channel depends on the size and can be calculated as:

#!/bin/bash
###
### my-script — does one thing well
###
### Usage:
### my-script <input> <output>
###
### Options:
### <input> Input file to read.
### <output> Output file to write. Use '-' for stdout.
Rank Type Prefix/Suffix Length
1 Prefix my+ 2
2 Suffix +online 6
3 Prefix the+ 3
4 Suffix +web 3
5 Suffix +media 5
6 Prefix web+ 3
7 Suffix +world 5
8 Suffix +net 3
9 Prefix go+ 2
@dhh
dhh / tracker_blocking.rb
Last active June 30, 2024 14:35
Current list of spy pixels named'n'shamed in HEY, as of April 23, 2020
module Entry::TrackerBlocking
extend ActiveSupport::Concern
included do
has_many :blocked_trackers
end
email_service_blockers = {
"ActiveCampaign" => /lt\.php(.*)?l\=open/,
"AWeber" => "openrate.aweber.com",
@ritaly
ritaly / fix_rvm_abort.md
Last active April 19, 2022 15:53
Ruby macOS Catalina: Fixing the abort trap

where: macOS Catalina when: Homebrew’s / rvm after Ruby update to 2.6 or 2.7 fails with abort or Abort trap: 6.
pre: make sure you're using newest rvm version rvm get stable .

All rake and rails command crashed Noticed that rails tasks like rake or rails console, rails db:create, rails db:migrate (info - added only for better googling) these command crashed with the output aborted. No errors only with abord or Abort trap: 6

⚠️ check your local paths!

This is an issue with some OpenSSL libraries. So quick fix:

@bretton
bretton / ln-dashboard-list.md
Last active August 17, 2024 15:50
Dashboard tools for Lightning servers

Lightning dashboards

clightning

NodeMonitor

NodeMonitor is a simple Python Django website that makes calls to Bitcoin (bitcoind) and Lightning Network (c-lightning lightningd) nodes and displays the results on a simple 'dashboard' style status page.

Zabbix clightning

@deHelden
deHelden / "torn" 1 Setup vps.md
Last active April 2, 2025 21:13
Deploy Rails 7.0.4.2 to VPS(DigitalOcean Ubuntu 20). Nginx, Puma, Capistrano3, PostgreSQL, Rbenv.

SETUP VPS

based on DigitalOcean guide

Create local project

local$ rails new appname -T -d postgresql
local$ rails g scaffold Story title:string body:text
local$ rails db:migrate
@r-malon
r-malon / monokai.md
Created February 27, 2019 19:15
Monokai colors in RGB and HEX format, taken from Sublime Text 3

Monokai Colors in RGB and HEX format


  • Background: (46, 46, 46); #2e2e2e
  • Comments: (121, 121, 121); #797979
  • White: (214, 214, 214); #d6d6d6
  • Yellow: (229, 181, 103); #e5b567
  • Green: (180, 210, 115); #b4d273
  • Orange: (232, 125, 62); #e87d3e
  • Purple: (158, 134, 200); #9e86c8