Skip to content

Instantly share code, notes, and snippets.

View hjnp's full-sized avatar
🙉
focusing

Helder Pinto hjnp

🙉
focusing
View GitHub Profile
Hosted Main Chain Explorers:
https://ethtools.com/mainnet/chain
Can explore:
Contract Addresses
Non Contract Addresses
Transactions (and their internal steps)
Blocks
Contract Code
https://www.etherchain.org
it("testing data payload", async () => {
const address = inbox.options.address;
const abi = interface;
// ganache account 0
const account = "0x962E563Fed877b31fd5108bC27E330354fE8D3a4";
const privateKey = Buffer.from(
"3e7966932fba69ea323e8c9223ebecbc2ff06c6d46216577e3c853372d56b5e3",
@hjnp
hjnp / inst.md
Last active August 22, 2018 13:11
inst.md

Instalar winrar 64 bits de preferencia Serve para descompactar ficheiros .rar .zip https://www.win-rar.com/predownload.html?&L=0 basta dar click no botão direito do rato e ir as opçoes ...

Notas:

  • Para cada um dos seguintes passos de instalação exemplo office, desinstalar o atual e reiniciar e instalar o pirata. quando se instala algo pirata desconecta-se da internet durante o processo de instalação.
  • Deixar o antivirus para o fim.
# Rails Migration
http://guides.rubyonrails.org/migrations.html
## Migrations methods:
* add_column
* add_index
* change_column
* change_table
* create_table
* drop_table
@hjnp
hjnp / gist:0aa8abf884b2343055abb3fad5e723cc
Created June 4, 2018 09:42
docker-compose postgres ^latest + adminer + pgadmin
version: '2'
services:
db:
image: postgres
restart: always
environment:
POSTGRES_PASSWORD: postgres
networks:
- postgres
/// PROMISE EX:
function examplePromise() {
return new Promise(function(resolve, err) {
setTimeout(resolve('Hello promise'), 100)
});
}
examplePromise()
.then( (res) => console.info('res', res))

##what are generators##

  • They're pausable functions, pausable iterable functions, to be more precise
  • They're defined with the *
  • every time you yield a value, the function pauses until .next(modifiedYieldValue) is called
var myGen = function*() {
  var one = yield 1;
  var two = yield 2;
  var three = yield 3;
 console.log(one, two, three);
@hjnp
hjnp / Node.js File Looper
Created February 7, 2018 21:23 — forked from adamwdraper/Node.js File Looper
Loop through all files in a given directory with node.js
var fs = require('fs');
var walkPath = './';
var walk = function (dir, done) {
fs.readdir(dir, function (error, list) {
if (error) {
return done(error);
}