Skip to content

Instantly share code, notes, and snippets.

View mrs83's full-sized avatar

Massimo R. S. mrs83

  • Berlin, Germany
View GitHub Profile
@helephant
helephant / !calling-lambda-cross-account.md
Last active October 24, 2023 03:52
Calling a lambda in another AWS account by assuming a cross-account IAM role

Set up a cross-account IAM role in the destination account

  • Add a new IAM role
  • For type of trusted entity select "another AWS account"
  • Specify the accountId of the account that will be using the resource in the destination account. You can find your AWS Account ID, which is available on the support homepage when you are logged in.
  • Create a policy that allows lambda:InvokeFunction for your function and attach it to this new role.

Create a lambda in the calling account.

  • Set up a role for your lambda that is allowed to assumeRole
  • Use the AWS SDK to assume the new role in the destination account.
  • Pass the credentials to the lambda object when you create it
@sstone
sstone / eclair-ltc-demo.md
Last active June 22, 2019 06:53
Setting up eclair on Litecoin testnet

Running eclair on Litecoin

We need:

  • A fully synchronized Litecoin node on testnet, with Zmq notifications enabled (this is easily available on Linux only at the moment)
  • Our Lightning Node, eclair, which you can get there: https://github.com/ACINQ/eclair

We then create 3 directories for our eclair node, create an eclair.conf configuration file in each data directory, and all we need to change are the connections ports (so they can connect to the Litecoin client) and the fee rate (so that our opening/closing transactions will be relayed by the Litecoin client). And that’s it ! You can even see in the video that labels are still in BTC/milliBTC.

We then connected A to B, B to C, waited for all funding transactions to be confirmed and all channels announced, made a few payments, closed all channels and waited again for all closing transactions to be confirmed.

@muggin
muggin / char-rnn-model-tf.py
Last active August 6, 2017 17:52
Vanilla Char-RNN class using TensorFlow
"""
Vanilla Char-RNN class using TensorFlow by Wojciech Kryscinski (@muggin).
Adapted from Vinh Khuc's min-char-rnn-tensorflow.py
https://gist.github.com/vinhkhuc/7ec5bf797308279dc587
Requires tensorflow>=1.0
BSD License
"""
class TFBasicRNN(object):
def __init__(self, vocab_size, hidden_size, seq_length):
@takinbo
takinbo / lnd-python-client.md
Created January 29, 2017 23:27
Writing a Python gRPC client for the Lightning Network Daemon

How to write a Python gRPC client for the Lightning Network Daemon

  • Create a virtual environment for your project
$ virtualenv lnd
  • Activate the virtual environment
$ source lnd/bin/activate
@t4sk
t4sk / segwit-regtest.md
Created December 29, 2016 21:51
How to activate segwit on regtest

How to activate segwit on regtest

Start bitcoind

> bitcoind -regtest -daemon

Generate block chain

> bitcoin-cli -regtest generate 432
@t4sk
t4sk / regtest.md
Last active December 31, 2017 19:31
How to get bitcoins for development using Regtest

How to get bitcoins for development using Regtest

Start bitcoind

> bitcoind -regtest -daemon

Generate block chain

> bitcoin-cli -regtest generate 101

DraftJS Preact Demo

Start

npm install

npm start

Go to localhost:8080

@c9s
c9s / .babelrc
Last active October 21, 2023 14:04
webpack + babel + typescript + es6 - total solutions!
{
"presets": ["es2015"],
"plugins": ["transform-runtime"]
}
@marteinn
marteinn / filters.py
Last active November 28, 2019 09:19
Sorting by distance filter for django-restframework-gis. MIT license.
# -*- coding: utf-8 -*-
"""
This is an extension to django-restframework-gis that extends on
DistanceToPointFilter and adds sorting by distance.
It is also possible to add a extra distance field to the returned queryset by
adding the flag distance_filter_add_distance = True to the DRF View.
"""
@rochacbruno
rochacbruno / Makefile
Last active June 22, 2022 23:35
Python Setup Tips and Tricks http://j.mp/setup_py
.PHONY: test install pep8 release clean
test: pep8
py.test --cov -l --tb=short --maxfail=1 program/
install:
python setup.py develop
pep8:
@flake8 program --ignore=F403 --exclude=junk