Skip to content

Instantly share code, notes, and snippets.

View makevoid's full-sized avatar

Francesco 'makevoid' Canessa makevoid

View GitHub Profile
@makevoid
makevoid / VESC_LOG.txt
Created August 19, 2016 12:36
JSON time series to GIF with Image magick
{"t":3726,"avgMotorCurrent":-0.04,"avgInputCurrent":0.00,"dutyCycleNow":0.00,"rpm":0,"inpVoltage":12.50,"ampHours":0.00,"ampHoursCharged":0.00,"tachometer":3,"tachometerAbs":3}
{"t":3861,"avgMotorCurrent":-0.04,"avgInputCurrent":0.00,"dutyCycleNow":0.00,"rpm":0,"inpVoltage":12.50,"ampHours":0.00,"ampHoursCharged":0.00,"tachometer":3,"tachometerAbs":3}
{"t":3996,"avgMotorCurrent":-0.04,"avgInputCurrent":0.00,"dutyCycleNow":0.00,"rpm":0,"inpVoltage":12.50,"ampHours":0.00,"ampHoursCharged":0.00,"tachometer":3,"tachometerAbs":3}
{"t":491,"avgMotorCurrent":9938107.00,"avgInputCurrent":-15658230.00,"dutyCycleNow":32.07,"rpm":476977714,"inpVoltage":2373.20,"ampHours":-9614.15,"ampHoursCharged":-138981.31,"tachometer":-2070895143,"tachometerAbs":-1095942087}
{"t":629,"avgMotorCurrent":5369364.50,"avgInputCurrent":47511.12,"dutyCycleNow":8.19,"rpm":268435612,"inpVoltage":103.10,"ampHours":53693.64,"ampHoursCharged":0.00,"tachometer":3489536,"tachometerAbs":1054215}
{"t":770,"avgMotorCurrent":5369364.50,"avgInputCurren
@makevoid
makevoid / code_prettify.css
Created July 18, 2016 22:34
assets/css/vendor/code_prettify.css
.pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee}
@makevoid
makevoid / code_prettify.js
Last active July 18, 2016 22:35
assets/js/vendor/code_prettify.js
!function(){/*
Copyright (C) 2013 Google Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
@makevoid
makevoid / #vedder IRC log
Created May 2, 2016 00:00
vedder.vesc.irc.log
question: how to interface intel edison (arduino) with vesc?
teppic makevoid: I think you can control it via pwm (not 100% sure). Probably the easiest alternative.
guess you wanted more control than that though...
Sub|Afk has disconnected (Remote host closed the connection)
SubCreative joined
SubCreative has disconnected (Changing host)
SubCreative joined
SubCreative has disconnected (Remote host closed the connection)
SubCreative joined
@makevoid
makevoid / build_solidity.sh
Created April 9, 2016 21:46
Build solidity to have solc available for geth - you still need to pass "--solc $HOME/eth/solidity/build/solc/solc" as a flag when you run geth
mkdir -p ~/eth
cd ~/eth && git clone https://github.com/ethereum/webthree-helpers
cd ~/eth/webthree-helpers && git checkout release
cd ~/eth && webthree-helpers/scripts/ethupdate.sh --no-push --simple-pull --project solidity
cd ~/eth && webthree-helpers/scripts/ethbuild.sh --no-git --cores $(nproc) --project solidity
~/eth/solidity/build/solc/solc --version
@makevoid
makevoid / antani.js
Last active January 21, 2016 12:26
Just a test npm module to use with package.json repository gist rule - just use "repository": "gist:d6b9796cdd5ee631fe8a" to load this gist into your app
// usage:
//
// var antani = require("./antani.js")
//
// console.log(antani())
//
module.exports = function(){
return "antani";
}
@makevoid
makevoid / geth_mine.js
Last active October 16, 2016 12:43
Geth mining script, run as last argument of geth via `js geth_mine.js` - source: https://gist.github.com/makevoid/5a618d73c4eff110a21c
// fork of mine.js script on embark-framework, this script mines only if there are new transactions in the pool
var eth, config, main, pendingTransactions, startTransactionMining;
eth = web3.eth;
console.log('geth_mine.js: start');
console.log("node infos: " + (JSON.stringify(admin.nodeInfo)));
config = {
threads: 2 // set this to the number of threads you machine can handle, remember to set a low difficulty in your genesis block to mine faster
@makevoid
makevoid / geth_mine.coffee
Last active July 19, 2016 08:55
Geth mining script, run as last argument of geth via `js geth_mine.js`
# geth_mine.coffee - activate mining to mine pending transactions - forked by embark-framework
#
# library (from underscore)
now = Date.now or ->
(new Date).getTime()
debounce = (func, wait) ->
timeout = undefined
@makevoid
makevoid / solether.js
Last active June 11, 2016 19:46
Solether - solar powered autonomous entity that lets you charge your phone for ethers
/*jslint node:true, vars:true, bitwise:true, unparam:true */
/*jshint unused:false */
/*global */
// Solether - solar powered autonomous entity
var mraa = require('mraa');
var _ = require('underscore') // docs: http://underscorejs.org/
var Web3 = require('web3');
@makevoid
makevoid / math_challenge.rb
Last active September 22, 2015 14:44
Fun math operators challenge solved with programming
# problem: figure out the operations
#
# expression:
#
# "7 # 7 # 77 # 7 # 7 = 497"
# I'm not good at math so I made this program to solve the problem
operators = %w(+ - * /)
values = [7, 7, 77, 7, 7]