Skip to content

Instantly share code, notes, and snippets.

View niftynei's full-sized avatar
🧡
on sabbatical

neil saitug niftynei

🧡
on sabbatical
View GitHub Profile
@niftynei
niftynei / one_liners.erl
Created June 30, 2016 16:49
Handy Erlang One Liners
% Figure out how many messages there are in your mailbox
process_info(self(), message_queue_len).
% Register wall_clock & runtime
statistics(wall_clock), statistics(runtime).
% A function to check the next message in the mailbox
F = fun() -> receive X -> X after 0 -> no_message end end.
@niftynei
niftynei / git_101.md
Last active July 25, 2016 19:26
Git 101

Git 101

Hi, welcome to Git 101. Here's what we're going to learn today.

  • Making a new repo (and remotes)
  • Committing new changes
  • Branching out
  • Resolving conflicts
  • Merging vs Rebasing
keycodes: https://gist.github.com/awidegreen/3854277
let's talk about modes!
there are 3 modes.
"n" (or normal) mode
"i" (or insert) mode
"v" (or visual) mode
keyboard shortcuts that i use a lot:
@niftynei
niftynei / packages
Last active January 5, 2017 22:11
reaction crash
Error: The global definition of Mongo.Collection has changed since the job-collection package was loaded. Please ensure that any packages that redefine Mongo.Collection are loaded before job-collection.
at JobCollectionBase [as constructor] (packages/vsivsi_job-collection/src/shared.coffee:88:17)
at new JobCollection (packages/vsivsi_job-collection/src/server.coffee:27:7)
at meteorInstall.node_modules.meteor.reactioncommerce:reaction-collections.common.collections.collections.js (packages/reactioncommerce:reaction-collections/common/collections/collections.js:202:33)
at fileEvaluate (packages/modules-runtime.js:181:9)
at require (packages/modules-runtime.js:106:16)
at /home/niftynei/dev/reaction/.meteor/local/build/programs/server/packages/reactioncommerce_reaction-collections.js:1483:1
at /home/niftynei/dev/reaction/.meteor/local/build/programs/server/packages/reactioncommerce_reaction-collections.js:1510:3
at /home/niftynei/dev/reaction/.meteor/local/build/programs/server/boo
@niftynei
niftynei / gist:9865193
Created March 30, 2014 00:11
Java Example using Apache's OLTU OAuth2 library
/// GENERAL METHODS FOR OAUTH'ING
/// using the Apache Oltu library
/// https://cwiki.apache.org/confluence/display/OLTU/Index
public String getAuthUrl() {
OAuthClientRequest request = null;
try {
request = OAuthClientRequest
.authorizationLocation("https://www.hackerschool.com/oauth/authorize")
@niftynei
niftynei / keybase.md
Created July 27, 2018 21:15
keybase keybase

Keybase proof

I hereby claim:

  • I am niftynei on github.
  • I am niftynei (https://keybase.io/niftynei) on keybase.
  • I have a public key ASCz88tHziYE6EYbvLP0MWMvS2bUUAIW3b8sfHW9oMJ94go

To claim this, I am signing this object:

@niftynei
niftynei / dot.txt
Created September 5, 2019 17:39
notes from outputs investigation
wallet/db.c -> table schemas + migrations
wallet/wallet.c -> SQL statements
table: outputs
question: what are the values for 'status'
output_state_available= 0,
output_state_reserved = 1,
output_state_spent = 2,
/* Output has been included in a signed funding tx that we've shared
* with a peer; not yet mempooled. Eligible for burning */
@niftynei
niftynei / prometheus_snippet.py
Created September 24, 2019 17:38
prometheus configuration python
plugin.add_option(
    'prometheus-listen',
    '0.0.0.0:9900'
    'Address and port to bind to'
)
@niftynei
niftynei / lightning.conf
Created September 24, 2019 17:40
Example lightning conf
network=bitcoin
bitcoin-rpcuser=plugin-user
bitcoin-rpcpassword=plugin-pass
plugin-dir=/usr/local/bin/plugins
@niftynei
niftynei / shell.sh
Created September 24, 2019 17:40
Command to start c-lightning with Docker
docker run -d \
--network=host \
--name=lightning \
-v ~/extra/lightning:/root/.lightning \
blockstream/lightningd:prom lightningd --conf=/root/.lightning/lightning.conf