Skip to content

Instantly share code, notes, and snippets.

Verifying that +advaith is my blockchain ID. https://onename.com/advaith
@AdvaithD
AdvaithD / gist:fcdfbf5a2707ca3b022b65287c9c036f
Created November 1, 2017 01:45
stop tracking 'node_modules' in a git repo
$ touch .gitignore
$ nano .gitignore
Add 'node_modules' to .gitignore file
$ git rm -r --cached node_modules
$ git commit -m 'Stopped tracking node modules'
$ git push -u origin master
SELECT contracts.address, COUNT(1) AS tx_count
FROM `bigquery-public-data.ethereum_blockchain.contracts` AS contracts
JOIN `bigquery-public-data.ethereum_blockchain.transactions` AS transactions ON (transactions.to_address = contracts.address)
WHERE contracts.is_erc20 = TRUE
GROUP BY contracts.address
ORDER BY tx_count DESC
LIMIT 10
@AdvaithD
AdvaithD / error
Created February 18, 2019 02:08
cra error
0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/Cellar/node/11.10.0/bin/node',
1 verbose cli '/usr/local/bin/npm',
1 verbose cli 'run',
1 verbose cli 'start' ]
2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle [email protected]~prestart: [email protected]
6 info lifecycle [email protected]~start: [email protected]
@AdvaithD
AdvaithD / correlation.js
Created March 18, 2019 17:44
pearson correlation coefficient
/** * calculates pearson correlation
* @param{number[]}d1
* @param{number[]}d2
*/
export function corr(d1, d2) {
let { min, pow, sqrt } =Math
let add = (a, b) => a + b
let n = min(d1.length, d2.length)
if (n ===0) {
return0
@AdvaithD
AdvaithD / graph.js
Created April 15, 2019 16:37
Graph
class Graph {
constructor() {
this.adjacencyList = new Map();
}
addVertex(nodeVal) {
this.adjacencyList.set(nodeVal, []);
}
addEdge(src, dest) {

Keybase proof

I hereby claim:

  • I am advaithd on github.
  • I am bitcoiner (https://keybase.io/bitcoiner) on keybase.
  • I have a public key ASAJdwsAFAa1a7qn_5DsxrfSItEm1FDYzAhFG7ym2ghsJQo

To claim this, I am signing this object:

Keybase proof

I hereby claim:

  • I am advaithd on github.
  • I am advaith (https://keybase.io/advaith) on keybase.
  • I have a public key ASDGDMPu8z0Vd9n1PjY_-SilJ4pEp-cyidEbqWXuSkr0ywo

To claim this, I am signing this object:

const config = require('../config.json')
const uuidv4 = require('uuid/v4')
const low = require('lowdb')
const log = require('npmlog')
const FileSync = require('lowdb/adapters/FileSync')
// Read from bank of keys
const readAdapter = new FileSync('../keysDB.json')
const readDB = low(readAdapter)
// Sample DB to mock medici distribution state
const writeAdapter = new FileSync('./mockMedici.json')
@AdvaithD
AdvaithD / init.vim
Created April 25, 2020 04:20
neovim setup
call plug#begin(stdpath('data') . '/plugged')
" Plug 'dracula/vim' " Theme
" Plug 'morhetz/gruvbox'
Plug 'drewtempelmeyer/palenight.vim'
Plug 'scrooloose/nerdtree' " file explorer
Plug 'ryanoasis/vim-devicons'
Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' }
Plug 'junegunn/fzf.vim'
Plug 'airblade/vim-gitgutter'
Plug 'vim-airline/vim-airline'