Skip to content

Instantly share code, notes, and snippets.

View luandro's full-sized avatar

luandro luandro

View GitHub Profile
@phaseOne
phaseOne / balena-offline-update.sh
Last active September 9, 2022 00:51
An interactive bash script that performs a Balena Offline Update on an SD card
#!/bin/bash
# NOTE: This script requires that jq is installed on your system.
set -euo pipefail
# set -x
echo "Specify the path to your SSH public key. It will be added to the device and used to SSH into the device after provisioning to help in debugging if needed."
read -r -p 'Path to your SSH public key: ' ssh_key
if [ -z "$ssh_key" ]; then
@runo280
runo280 / 00readme.md
Last active September 29, 2020 11:36
Download script for C@ster.i0 free courses

How to use

1- Install requirements

This command is for Ubuntu based distros

sudo apt install aria2 youtube-dl

2- Make [course_name].sh file excutable:

chmod +x [course_name].sh

@gmaclennan
gmaclennan / guyana-volunteer-wifi.md
Last active July 4, 2018 18:43
Long-distance solar-powered wifi in the forests and savannahs of Guyana

Overview

Digital Democracy is looking for a volunteer to help pilot long-distance solar-powered wifi antennaes in indigenous communities in Guyana.

Background

Digital Democracy is working with the Wapichan people in the South Rupununi in Guyana to support them in efforts to secure their ancestral territory and increase their autonomy and self-determination. The Wapichan live in 17 villages and 7 smaller "satellites" in a large semi-natural savannah ecosystem surrounded by tropical forest. Communication between villages and with the outside world is difficult due to limited or no cellphone or internet access. We want to help the Wapichan improve their means of communicating with the rest of the world and communicating and coordinating between villages.

Location

Can we create a smart contract VM on nodejs using Dat?

Ethereum is a trustless network of VMs which run smart contracts submitted by users. It uses proof-of-work to synchronize state across the network, and has every node execute the contracts in order to verify the state's validity. Each transaction is stored in the blockchain for replayability. Read more about it here.

Ethereum's "trustless network" model has some disadvantages:

  • Transaction processing is slow - it maxes at roughly 25tx/s right now for all contracts combined.
  • Every transaction costs money to execute.
  • The entire blockchain state must be shared across the computing network.
  • No private transactions.

Using Dat with a github.io domain

https://i.imgur.com/akOrIOq.png

My personl site is hosted at hashbase.io (link) so that you can access it via dat and https. My canonical dat url is dat://pfrazee.hashbase.io.

Before I used hashbase I used Github Pages, and today it dawned on me that I can have dat://pfrazee.github.io work too. It's pretty simple if you know the dat dns spec.

All I had to do was add /.well-known/dat to my site (click to view). I put the raw dat URL of my site in that file, along with a TTL.

{
"UF": [
{"nome": "Acre", "sigla": "AC"},
{"nome": "Alagoas", "sigla": "AL"},
{"nome": "Amapá", "sigla": "AP"},
{"nome": "Amazonas", "sigla": "AM"},
{"nome": "Bahia", "sigla": "BA"},
{"nome": "Ceará", "sigla": "CE"},
{"nome": "Distrito Federal", "sigla": "DF"},
{"nome": "Espírito Santo", "sigla": "ES"},
@rgrove
rgrove / README.md
Created February 8, 2016 19:01
Cake's approach to React Router server rendering w/code splitting and Redux

Can't share the complete code because the app's closed source and still in stealth mode, but here's how I'm using React Router and Redux in a large app with server rendering and code splitting on routes.

Server

  1. Wildcard Express route configures a Redux store for each request and makes an addReducers() callback available to the getComponents() method of each React Router route. Each route is responsible for adding any Redux reducers it needs when it's loaded. (This isn't really necessary on the
@oviava
oviava / redux-socket.jsx
Last active November 12, 2017 05:24
handling socket events with redux
const types = {
ADD_TODO: 'ADD_TODO',
DELETE_TODO: 'DELETE_TODO',
COMPLETE_TODO: 'COMPLETE_TODO',
};
const socketEvents = {
ADD_TODO_SUCCESS: 'ADD_TODO_SUCCESS',
ADD_TODO_FAIL: 'ADD_TODO_FAIL',
};

Usage

  1. npm install babel-loader imports-loader webpack --save
  2. Create webpack.config.js
  3. Move index.ios.js to src/index.ios.jsx
  4. webpack --watch

Example

src/index.ios.jsx

2015-01-29 Unofficial Relay FAQ

Compilation of questions and answers about Relay from React.js Conf.

Disclaimer: I work on Relay at Facebook. Relay is a complex system on which we're iterating aggressively. I'll do my best here to provide accurate, useful answers, but the details are subject to change. I may also be wrong. Feedback and additional questions are welcome.

What is Relay?

Relay is a new framework from Facebook that provides data-fetching functionality for React applications. It was announced at React.js Conf (January 2015).