Skip to content

Instantly share code, notes, and snippets.

View gr33ngr33n's full-sized avatar
🏠
πŸ‘πŸŒ³πŸŒ²πŸ”†

gr33ngr33n

🏠
πŸ‘πŸŒ³πŸŒ²πŸ”†
View GitHub Profile
@gr33ngr33n
gr33ngr33n / ListenToEventsTruffleAnyWeb3.js
Created April 1, 2021 16:05 β€” forked from sogoiii/ListenToEventsTruffleAnyWeb3.js
Example on how to use truffle to listen to events in your smart contracts
const Web3 = require('web3') // Web3 0.20.4 or web3 1 beta
const truffleContract = require("truffle-contract")
const contractArtifact = require('./build/contracts/TutorialToken.json')
const providerUrl = 'http://localhost:8545'
const provider = new Web3.providers.HttpProvider(providerUrl)
const contract = truffleContract(contractArtifact)
contract.setProvider(provider)
@gr33ngr33n
gr33ngr33n / CONCURRENCY.md
Created January 17, 2021 08:08 β€” forked from montanaflynn/CONCURRENCY.md
Examples of sequential, concurrent and parallel requests in node.js

Concurrency in JavaScript

Javascript is a programming language with a peculiar twist. Its event driven model means that nothing blocks and everything runs concurrently. This is not to be confused with the same type of concurrency as running in parallel on multiple cores. Javascript is single threaded so each program runs on a single core yet every line of code executes without waiting for anything to return. This sounds weird but it's true. If you want to have any type of sequential ordering you can use events, callbacks, or as of late promises.

@cjaoude
cjaoude / chmod-tutorial.md
Last active May 7, 2024 11:58
chmod tutorial / cheat sheet / cheatsheet / for dummies

chmod
Forget the chmod octals (the numbers). Set permission the easy way using the keywords

// know the ownerships:
u = User (you)
g = Group
o = Other (aka. 'World')
a = All of the above

@montanaflynn
montanaflynn / CONCURRENCY.md
Last active November 7, 2024 18:22
Examples of sequential, concurrent and parallel requests in node.js

Concurrency in JavaScript

Javascript is a programming language with a peculiar twist. Its event driven model means that nothing blocks and everything runs concurrently. This is not to be confused with the same type of concurrency as running in parallel on multiple cores. Javascript is single threaded so each program runs on a single core yet every line of code executes without waiting for anything to return. This sounds weird but it's true. If you want to have any type of sequential ordering you can use events, callbacks, or as of late promises.