This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var ethers = require('ethers'); | |
var Wallet = ethers.Wallet; | |
var utils = ethers.utils; | |
var privateKey = '<privatekey>' | |
var wallet = new ethers.Wallet(privateKey); | |
var transaction = { | |
// needs to be greater than the nonce of the previous tx | |
// from this wallet | |
// can skip values |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// requires ethereumjs-util and ethers, 3rd party npm packages. | |
/* | |
Ran on macbook with these results: | |
10000 ran with 0 errors. | |
real 0m28.769s | |
user 0m28.301s | |
sys 0m0.246s |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl -H "Content-Type: application/json" -X POST --data '{"jsonrpc":"2.0","method":"web3_clientVersion","params":[],"id":67}' localhost:8545 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
contract TestEvent{ | |
string greeting; | |
event TeEv(string input); | |
function TestEvent(string _greeting){ | |
greeting = _greeting; | |
} | |
function get_greeting() constant returns(string){ | |
TeEv("in get_greeting function"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(use 'clojure.core.async) | |
(def input-chan (chan)) | |
(def our-pub (pub input-chan :msg-type)) | |
(>!! input-chan {:msg-type :greeting :text "hello"}) | |
(def output-chan (chan)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#lang racket | |
(define (atom? item) | |
(not (pair? item))) | |
(define (numbered? aexp) | |
(cond [(atom? aexp) (number? aexp)] | |
[else | |
(and (numbered? (car aexp)) | |
(numbered? (car (cdr (cdr aexp)))))])) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta name="viewport" content="initial-scale=1.0, user-scalable=no"> | |
<meta charset="utf-8"> | |
<title>Simple markers</title> | |
<style> | |
html, body, #map-canvas { | |
height: 100%; | |
margin: 0; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
data MyVector a = XY a a deriving (Show) | |
xcord :: (Num a) => MyVector a -> a | |
xcord (XY a _) = a | |
ycord :: (Num a) => MyVector a -> a | |
ycord (XY _ a) = a | |
subVect :: (Num a) => MyVector a -> MyVector a -> MyVector a | |
subVect (XY x1 y1) (XY x2 y2) = XY (x1 - x2) (y1 - y2) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function arrayOfLight(x){ | |
res = [] | |
for(i = 0; i <= x; i++){ | |
res.push(i); | |
} | |
return res; | |
} |
NewerOlder