Skip to content

Instantly share code, notes, and snippets.

View makevoid's full-sized avatar

Francesco 'makevoid' Canessa makevoid

View GitHub Profile
@makevoid
makevoid / foo.rb
Last active June 23, 2018 02:27
ruby module with js-style imports/exports
BAZ = MODULE_EXPORTS.fetch :baz
module Foo
bar = -> {
baz = BAZ
baz.()
}
BAR = bar
end
@makevoid
makevoid / bindings.txt
Created March 29, 2018 22:37
Fastscript applescripts
1 - alt1
2 - alt2
3 - alt3
4 - ±
@makevoid
makevoid / bitcore-lib-privatekey-to-web3-account.js
Last active January 24, 2018 23:22
Bitcore-lib PrivateKey to Web3 account
const Web3 = require('web3')
const web3 = new Web3("http://mainnet.infura.io")
const eth = web3.eth
const bitcore = require('bitcore-lib')
const PrivateKey = bitcore.PrivateKey
const privateKey = new PrivateKey()
eth.accounts.privateKeyToAccount(`0x${privateKey.toString()}`)
@makevoid
makevoid / bucket_policy.json
Created December 18, 2017 18:11
S3 AWS Policy - Allow access and management of a single bucket + list buckets permission (so most S3 clients don't complain - remove the ListAllMyBuckets and restrict bucket management for extra security)
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": "s3:*",
"Resource": [
"arn:aws:s3:::BUCKET_NAME",
"arn:aws:s3:::BUCKET_NAME/*"
]
@makevoid
makevoid / run-latest-cmd.applescript
Last active November 21, 2017 10:42
Run the latest command in terminal via Applescript
# focus terminal
tell application "Terminal"
activate
end tell
# up arrow - enter (run last command)
tell application "System Events"
key code 126
key code 36
end tell
@makevoid
makevoid / deploy.js
Created November 14, 2017 12:21
Web3 Beta deploy code
#! /usr/bin/env node
const c = console
const Web3 = require('web3')
const {promisify} = require('util')
const web3 = new Web3('ws://localhost:8546') // ws are faster
// const web3 = new Web3('http://localhost:8545') // standard http json rpc
@makevoid
makevoid / ABToken.sol
Created November 13, 2017 22:28
Applied Blockchain ERC20 Token
pragma solidity ^0.4.8;
contract ABTokenBase {
/* This is a slight change to the ERC20 base standard.
function totalSupply() constant returns (uint256 supply);
is replaced with:
uint256 public totalSupply;
This automatically creates a getter function for the totalSupply.
This is moved to the base contract since public getter functions are not
currently recognised as an implementation of the matching abstract
@makevoid
makevoid / kovan-address.txt
Created July 22, 2017 06:52
kovan-address.txt
0xf9adB4852142fa22D8DE96c7cFcEEe500803f1f1
pragma solidity ^0.4.8;
// ----------------------------------------------------------------------------------------------
// Sample fixed supply token contract
// Enjoy. (c) BokkyPooBah 2017. The MIT Licence.
// ----------------------------------------------------------------------------------------------
// ERC Token Standard #20 Interface
// https://github.com/ethereum/EIPs/issues/20
contract ERC20Interface {
@makevoid
makevoid / vesc6-8s5p-single-motor-6374-FOC-config.md
Last active October 25, 2017 03:44
VESC 6 - 8S5P - Single Motor 6374 190KV - FOC - default settings

Single motor 6374 190KV FOC Vesc config (via auto detection) 10S8P li-ion w/ BMS (1y low usage)

I followed the wizard and used the default FOC detection settings, I just modified the current limits (motor/battery) + PPM settings obviously. I haven't changed (played with) any custom FOC setting yet as the default one seem to be good enough.

DATA

Rider Weight ~100kg

Top Speed: 40 km/h (23 mph) when fully charged