Skip to content

Instantly share code, notes, and snippets.

View harshjv's full-sized avatar

Harsh Vakharia harshjv

View GitHub Profile
@harshjv
harshjv / index.html
Created April 29, 2020 14:09
Stonks – Sparklines Renderer
<div class="container">
<h2><span>Stonks</span>, the sparkline renderer</h2>
<p>Here's a Stonk on my Wall Street bets, <span class="stonk"></span> . It's fine.
Here's a Stonk on my coffee consumption throughout the week <span class="stonk"></span>.</p>
<section>
<p><strong>Stonks</strong> can generate small visual aids for data right into an inline block of text, in the middle of a sentence for instance, or inside a title. <strong>Stonks</strong> automatically matches the line height of the inline element it's inside. </p>
</section>
</div>
@harshjv
harshjv / index.html
Created April 29, 2020 14:01
THREE Image Transition
<div id="three-container"></div>
<div id="instructions">
click and drag to control the animation
</div>
@harshjv
harshjv / mongo.js
Last active November 20, 2019 12:07
Download, extract, run mongodb from node.js
const path = require('path')
const { spawn } = require('child_process')
const mkdirp = require('mkdirp')
const tar = require('tar')
const axios = require('axios')
const mongoUrl = require('mongodb-download-url')
const PORT = 23456
const DOWNLOAD_DIR = path.join(__dirname, 'mongodb')
/* global window */
import _ from 'lodash'
import { BigNumber } from 'bignumber.js'
import EthereumTx from 'ethereumjs-tx'
import Wallet from 'ethereumjs-wallet'
import EthCrypto from 'eth-crypto';
import Provider from '@liquality/provider'
@harshjv
harshjv / README.md
Created October 23, 2018 15:06
The Zen of Liquality

The Zen of Liquality

  • The Times 03/Jan/2009 Chancellor on brink of second bailout for banks
  • If you’re part of their transaction, you’re part of the problem
  • Start by removing yourself
  • Be gone middlemen
  • You don't need an exchange to exchange
  • Exchange is a verb not a noun
  • Communal smart contracts are for intermediaries
  • Decentralization != Disintermediation
@harshjv
harshjv / symlink
Created October 9, 2018 07:59
Install (symlink) bitcoind package on *nix from bitcoin.tar.gz
var Web3 = require('web3')
var ProviderEngine = require('web3-provider-engine')
var RpcSubprovider = require('web3-provider-engine/subproviders/rpc')
var LedgerWalletSubproviderFactory = require('ledger-wallet-provider').default
var engine = new ProviderEngine()
var web3 = new Web3(engine)
var ledgerWalletSubProvider = async LedgerWalletSubproviderFactory()
engine.addProvider(ledgerWalletSubProvider)
contract IOwned {
// this function isn't abstract, since the compiler emits automatically generated getter functions as external
function owner() public view returns (address) {}
function transferOwnership(address _newOwner) public;
function acceptOwnership() public;
}
import { Client, providers, networks } from 'chainabstractionlayer'
const { BitcoinRPCProvider, BitcoinLedgerProvider } = providers.bitcoin
const { EthereumRPCProvider, EthereumLedgerProvider } = providers.ethereum
const bitcoin = new Client()
bitcoin.addProvider(new BitcoinRPCProvider('http://localhost:8080', 'bitcoin', 'local321'))
bitcoin.addProvider(new BitcoinLedgerProvider({ network: networks.bitcoin }))
const ethereum = new Client()
ethereum.addProvider(new EthereumRPCProvider('http://localhost:8545', 'ethereum', 'local321'))