Skip to content

Instantly share code, notes, and snippets.

@raza-basit
raza-basit / keybase.md
Created March 20, 2017 08:32
keybase.md

Keybase proof

I hereby claim:

  • I am geek96 on github.
  • I am geek96 (https://keybase.io/geek96) on keybase.
  • I have a public key whose fingerprint is 58E3 7E8C 7401 723B FE4A 4E31 F0DF 9354 CB39 8BAC

To claim this, I am signing this object:

import groovy.json.JsonSlurper
import groovy.json.JsonOutput
def formatJson(json) {
def obj = new JsonSlurper().parseText(json)
def map = [:]
if(obj instanceof Map) {
obj.each {
pragma solidity ^0.4.2;
/*contract token {
function transfer(address receiver, uint amount){}
}*/
contract Crowdsale {
address beneficiary;
uint fundingGoal;
uint amountRaised;
uint deadline;
0xf3ff214bdf7ce2de7e927955b540bb34ea277be0
@raza-basit
raza-basit / eth-accounts.go
Created September 7, 2017 09:52
Get List of accounts in ethereum node using golang
var callOptions = []byte(`{"jsonrpc": "2.0", "method":"personal_listAccounts", "params":[], "id":1}`)
req, err := http.NewRequest("post", "http://localhost:8545/", bytes.NewBuffer(callOptions))
if err != nil {
log.Fatal(err)
}
client := &http.Client{}
resp, err := client.Do(req)
@raza-basit
raza-basit / create-account.go
Created September 7, 2017 09:53
Creating ethereum account using golang
var callOptions = []byte(`{"jsonrpc": "2.0", "method":"personal_newAccount", "params":["yourpassword"], "id":"1"}`)
req, err := http.NewRequest("post", "http://localhost:8545/", bytes.NewBuffer(callOptions))
if err != nil {
log.Fatal(err)
}
client := &http.Client{}
resp, err := client.Do(req)

Keybase proof

I hereby claim:

  • I am geek96 on github.
  • I am boltxyz (https://keybase.io/boltxyz) on keybase.
  • I have a public key ASDQkmAhoxPSI2zKBm5WFXfFko6VOG-wSvrbIzntpkGsLQo

To claim this, I am signing this object:

// yarn add eosjs or npm install eosjs
const { Api, JsonRpc, RpcError } = require('eosjs');
const { JsSignatureProvider } = require('eosjs/dist/eosjs-jssig'); // development only
const fetch = require('node-fetch'); // node only; not needed in browsers
const { TextEncoder, TextDecoder } = require('util'); // node only; native TextEncoder/Decoder
const { TextEncoder, TextDecoder } = require('text-encoding');
const defaultPrivateKey = "<private_key_of_existing_eos_account_name>";
const signatureProvider = new JsSignatureProvider([defaultPrivateKey]);
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=2.0">
<title>squacky | typewriter effect using CSS</title>
<style>
:root {
-moz-transform: scale(2.5); /*This is for demo purposes only.*/