Skip to content

Instantly share code, notes, and snippets.

View abrkn's full-sized avatar

Andreas Brekken abrkn

View GitHub Profile
@jborichevskiy
jborichevskiy / jon-roam-daily-template.md
Last active August 31, 2022 04:41
The daily template I use for Roam Research https://roamresearch.com/
  • Weekly Agenda (created on a different day, and embedded with /Block Reference)
  • [[Morning Questions]]
    • {{[[slider]]}} How many hours of sleep did I get?
    • What's one thing top of mind today?
    • What's the one thing I need to get done today to make progress?
    • Review #[[Index: Questions]] #values
  • Agenda
    • {{[[TODO]]}} Morning walk #goal-health #habit
    • {{[[TODO]]}} Check calendar for scheduled events
  • {{[[TODO]]}} Morning focus hour
@mrfelton
mrfelton / unlock.sh
Last active July 30, 2019 07:29
Shell script to unlock lnd on system startup
#!/bin/bash
# Do nothing if the WALLET_PASSWORD var is not set.
if [ -z "$PASSWORD" ]; then
echo "[lnd_unlock] Please set PASSWORD in order to unlock wallet automatically."
s6-pause
fi
# output script content for easier debugging.
# set -x
# exit from script if error was raised.
set -e
@yinzara
yinzara / github_bitbucket_multiple_ssh_keys.md
Last active April 21, 2024 01:24
Managing SSH keys and repo cloning using multiple accounts on GitHub and BitBucket

Why Multiple SSH keys?

There are numerous reasons you may need to use multiple SSH keys for accessing GitHub and BitBucket

You may use the same computer for work and personal development and need to separate your work.

When acting as a consultant, it is common to have multiple GitHub and/or BitBucket accounts depending on which client you may be working for.

You may have different projects you're working on where you would like to segregate your access.

@statico
statico / circleci.yml
Created January 21, 2019 21:25
Node.js 10 + PostgreSQL CircleCI config
version: 2
workflows:
version: 2
build:
jobs:
- test
jobs:
test:
@abrkn
abrkn / drivechain.ai.md
Created October 22, 2018 10:42
Drivechain.ai

Drivechain.ai

The following toolkit makes getting started with Drivechain TestDrive easier and more fun!

Services

@abrkn
abrkn / drivechain-install-linux.sh
Last active October 31, 2018 04:10
Automatic installation of Drivechain TestDrive
#!/usr/bin/env bash
# AutoTestDrive v7
# Automation Drivechain TestDrive installation for Ubuntu
# Uses Drivenet-9, UTXO-7, Sidechain-8, Payment-1
#
# Changelog
#
# Revision 8
# - Do not restore wallet unless revision 8
# - Fix typo in wallet restore code (payment restored sidechain wallet)
@mcdougal
mcdougal / _error.js
Created September 28, 2018 11:53
Using @sentry/browser with Next.js for client and server-side rendering
import * as Sentry from '@sentry/browser';
import getConfig from 'next/config';
import React from 'react';
const { SENTRY_DSN } = getConfig().publicRuntimeConfig;
Sentry.init({ dsn: SENTRY_DSN });
/**
* Send an error event to Sentry.
@gavinandresen
gavinandresen / ReplayProtection.patch
Created June 15, 2017 15:15
OP_RETURN replay protection patch
diff --git a/src/policy/policy.cpp b/src/policy/policy.cpp
index ec398f662..6724399c0 100644
--- a/src/policy/policy.cpp
+++ b/src/policy/policy.cpp
@@ -117,6 +117,10 @@ bool IsStandardTx(const CTransaction& tx, std::string& reason, const bool witnes
return false;
}
+ if (tx.ReplayProtected()) {
+ return false;
@eiriklv
eiriklv / create-reconnecting-websocket.js
Last active March 9, 2019 14:14
Channels and websockets
/**
* Import dependencies
*/
const { EventEmitter } = require('events');
const ReconnectingWebSocket = require('reconnecting-websocket');
/**
* Export a function that creates a websocket connection interface
*/
export default function createReconnectingWebsocket(uri) {
@eiriklv
eiriklv / avoiding-exceptions.js
Last active February 2, 2019 12:13
Exception free JavaScript?
/**
* WHY? - BECAUSE EXCEPTIONS/TRY/CATCH IS A GLOBAL HORRIBLE MESS :-(
* Check out error handling in golang: https://blog.golang.org/error-handling-and-go
*/
/**
* Wrap an "unsafe" promise
*/
function safePromise(promise) {
return promise