Skip to content

Instantly share code, notes, and snippets.

André Neves andrerfneves

Block or report user

Report or block andrerfneves

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:810aa5b72614df8e98f1d6caa89de8f9
Links for BitDevs Nov 13th
https://github.com/joostjager/whatsat
https://github.com/jamaljsr/polar
https://blog.lightning.engineering/posts/2019/11/07/routing-guide-2.html
https://github.com/lightningnetwork/lightning-rfc/pull/694
https://github.com/lightningnetwork/lightning-rfc/pull/694
https://github.com/lightningnetwork/lightning-onion/pull/40
https://github.com/lightningnetwork/lightning-rfc/pull/697
https://github.com/lightningnetwork/lnd/pull/3462
https://github.com/lightningnetwork/lnd/pull/1160
View lnd_setup.md

Install LND

Install LND by cloning and building

Install Make

sudo apt-get install -y build-essential
View payment-stream.js
const sub = lnd.sendPayment();
sub.on('error', err => {
console.log("ERR", err);
})
sub.on('end', () => console.log("END"));
sub.on('status', status => console.log("STATUS", status));
sub.on('data', data => {
console.log("PAYMENT", data);
@andrerfneves
andrerfneves / lnurl-withdrawal.js
Created Oct 23, 2019 — forked from whiteyhat/lnurl-withdrawal.js
Backend implementation using adonis.js framework for Lightning Network withdrawals straight to wallet using LNURL
View lnurl-withdrawal.js
const Logger = use('Logger')
const bech32 = require('bech32')
const Hash = use('Hash')
const lnService = require('ln-service')
const NonceHashMap = {};
const k1HashMap = {};
async requestWithdrawal ({auth, response}) {
try{
View keybase.md

Keybase proof

I hereby claim:

  • I am andrerfneves on github.
  • I am andrerfneves (https://keybase.io/andrerfneves) on keybase.
  • I have a public key ASCB9Kh1_1Ku8bwmfr-O_LuiRg8PvDzjLQPIGDXkiK88ago

To claim this, I am signing this object:

View gist:027d89bed64a9f751ec5db2973ea0db5
Private Repository
In case our Github code repository is private, then cloning it on EC2 will fail.
In order to make it work, we will need to provide SSH access to the EC2 instance to login and clone the repo. Follow the steps in Generating SSH Keys to add SSH keys but here is the gist:
First create the SSH keys on EC2:
ls -al ~/.ssh
View ClickOutside React Component
// @flow
import React, { PureComponent } from 'react';
type Props = {
onClickOutside: Function,
children: any,
};
export default class ClickOutside extends PureComponent<Props> {
@andrerfneves
andrerfneves / main-container.js
Last active Aug 31, 2017
MainTileContainer: Container in a React Native application that handles business logic and mapping of application state to props. This leverages HOC components (redux's `connect`) for abstracting common logic between components.
View main-container.js
// @flow
import { connect } from 'react-redux';
import MainTileScreen from '../../screens/main-tile/main-tile';
import { fetchPageData } from '../../actions/api/page/fetch-page-data';
import { navigateToRoute } from '../../actions/navigation/navigate-to-route';
import { showModal } from '../../actions/navigation/show-modal';
import { toggleDrawer } from '../../actions/navigation/toggle-drawer';
const mapStateToProps = (state: Object) => ({
@andrerfneves
andrerfneves / fetch-page-data.js
Last active Aug 31, 2017
Typical API request for a React application using `redux-thunk` to handle asynchronous calls and trigger request, success, and error action creators.
View fetch-page-data.js
// @flow
import { getPageData } from '../../../services/api';
import { toggleAppStateLoading } from '../loading/toggle-app-state-loading';
import {
FETCH_PAGE_DATA_ERROR,
FETCH_PAGE_DATA_REQUEST,
FETCH_PAGE_DATA_SUCCESS,
} from '../../../constants/action-names';
@andrerfneves
andrerfneves / main-tile.js
Last active Aug 31, 2017
MainTileView: Component responsible for loading top level pages of a React Native application. It deals with loading dynamic JSON data from an API and follows an internal parsing algorithm to decide which components are rendered to the View. Some complex animation is also handled on the `onScroll` prop of the main ScrollView.
View main-tile.js
// @flow
import React, { Component } from 'react';
import { View, FlatList, RefreshControl, Animated } from 'react-native';
import LinearGradient from 'react-native-linear-gradient';
import Loader from '../../components/loader/loader';
import Navbar from '../../components/navbar/navbar';
import { parseMetadataIntoComponents } from '../../services/parse-metadata';
import { findPageDataByPath, findNavDataByPath, findNavIndexByPath } from '../../utils/array';
import { uuid } from '../../utils/uuid';
You can’t perform that action at this time.