Skip to content

Instantly share code, notes, and snippets.

View jiyu3's full-sized avatar

jiyu jiyu3

  • Midori
  • Tokyo
View GitHub Profile
@jiyu3
jiyu3 / file0.txt
Last active December 3, 2018 10:12
[Lightning Network] lnd のインストール ref: https://qiita.com/jiyu/items/85ba0a0ef0b238804918
sudo apt-get install golang-1.11-go
# E: Unable to locate package golang-1.11-go
# E: Couldn't find any package by glob 'golang-1.11-go'
# E: Couldn't find any package by regex 'golang-1.11-go'
@jiyu3
jiyu3 / file0.txt
Last active November 23, 2018 07:29
[Lightning Network] 接続用のノード文字列の正規表現 ref: https://qiita.com/jiyu/items/afb01d70dd3eeff59c11
let rxId = "^[0-9a-f]+" // hex string
let rxDomain = "(?!:\/\/)([a-zA-Z0-9-_]+\.)*[a-zA-Z0-9][a-zA-Z0-9-_]+\.[a-zA-Z]{2,11}?"
let rxIp = "(([1-9]?[0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([1-9]?[0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])"
let rxPort = "([0-9]{1,4}|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5])"
let rx = new RegExp(`${rxId}@(${rxDomain}|${rxIp}):${rxPort}`)
let nodeText = "02009947c197575f5a948e1e4343c41dc2e6122a9bd644629afb919f30e1115ff8@cln.green:9735"
console.log(nodeText.match(rx) != null) // true
@jiyu3
jiyu3 / file0.txt
Last active November 9, 2018 05:54
[Lightning Network] 自分のノードをQRコード化する ref: https://qiita.com/jiyu/items/9d97e91bde0bb679d493
02a68237add204623021d09b0334c4992c132eb3c9dcfcb8f3cf8a57386775538e@testnet-lnd.yalls.org:9735
@jiyu3
jiyu3 / file0.txt
Last active November 27, 2018 04:11
[Lightning Network] ifpaytt のインストール ref: https://qiita.com/jiyu/items/29f172613287fe88bb6f
sudo yarn global add ifpaytt
@jiyu3
jiyu3 / file0.txt
Last active November 27, 2018 04:10
[Lightning Network] Lightning Charge のインストール ref: https://qiita.com/jiyu/items/8a5d5ed420b83e47db93
sudo apt update
sudo apt install curl
curl -sL https://deb.nodesource.com/setup_8.x | sudo bash -
sudo apt install nodejs
node -v # バージョンが表示されれば成功
npm -v # バージョンが表示されれば成功
@jiyu3
jiyu3 / file0.txt
Last active November 27, 2018 04:10
[Lightning Network] bitcoind/lightningd をインストールする ref: https://qiita.com/jiyu/items/7130ddb49e532ac96ff0
# Press [ENTER] と言われるのでEnterを推してから次の行のコマンドへ
sudo apt-add-repository ppa:bitcoin/bitcoin
# 最新版にする
sudo apt update
# CUIを入れる
sudo apt install -y bitcoind
@jiyu3
jiyu3 / file0.txt
Last active October 28, 2018 20:16
btcpay を自分のサーバにインストールする ref: https://qiita.com/jiyu/items/11024b0b630a9bb9e585
sudo su -
cd /path/you/want/to/download/
git clone https://github.com/btcpayserver/btcpayserver-docker
cd btcpayserver-docker
function insertOnUrlChange(parent, funcname) {
let oldFunc = parent[funcname] ? parent[funcname] : function (){}
parent[funcname] = function() {
oldFunc.apply(this, arguments)
return window.onurlchange()
}
}
insertOnUrlChange(window.history, "pushState")
insertOnUrlChange(window.history, "replaceState")
@jiyu3
jiyu3 / file0.txt
Last active August 23, 2018 02:09
Tracking SPA application with Google Analytics / Google Tag Manager ref: https://qiita.com/jiyu/items/36e3ba4862cd1aaa8a7c
(function (i, s, o, g, r, a, m) {
i['GoogleAnalyticsObject'] = r;
i[r] = i[r] || function () {
(i[r].q = i[r].q || []).push (arguments)
}, i[r].l = 1 * new Date ();
a = s.createElement (o), m = s.getElementsByTagName (o)[0];
a.async = 1;
a.src = g;
m.parentNode.insertBefore (a, m)
}) (window, document, 'script', 'https://www.google-analytics.com/analytics.js', 'ga');
@jiyu3
jiyu3 / file0.txt
Last active August 23, 2018 02:10
Hook url change on SPA application ref: https://qiita.com/jiyu/items/1a117141f207b1faa925
function insertCallback(parent, funcname, callback, ...args) {
let oldFunc = parent[funcname] ? parent[funcname] : function (){}
parent[funcname] = function() {
oldFunc.apply(this, arguments)
return callback(...args)
}
}
function doSomething(args) {
// do what you want