Skip to content

Instantly share code, notes, and snippets.

View dhruvio's full-sized avatar

Dhruv Dang dhruvio

View GitHub Profile
@dhruvio
dhruvio / QODEX Ownership (Block 5015245).csv
Last active November 7, 2023 23:41
This CSV file shows the list of QODEX holders and their owned QODEX tokens at block 5015245. The owned QODEX tokens are shown in their raw form, and are scaled up by 10^18 per the norm of how decimals values are handled in smart contracts. NOTE: Some users mentioned a discrepancy in these numbers. We have determined that some QODEX tokens owned …
Address QODEX Tokens (Scaled by 10^18)
0xfbf0736eb2ac1c4bb0193ae54c53e182b18037fc 75000000000000000000
0xd5a5a7faaff1a6474bcd035a93f7da8118fc06a1 150000000000000000000
0xd16ae70faac612c914cd488ff816e62412f68c0f 3783680125637718999
0x4bafa8032fd0d20b8fd2bc75a6167b233796bb68 145395861465847906
0x2cbd624c41bd18078597a05a5b9a1d1d4b433f22 541000000000000000000
0xbd6fb6e1b59708c2c3840d4ab880ce0bfcfd2d5b 132172646604938271605
0x9d774e10058610430631673968acb55d2fd70973 177244699276733404
0x09e6ea36fa993f1f527fee7a70e9b5ecfb19676a 133941368241888047205
0x69ce540fbfeaee9dd2c402b16c00a5f8cdad7d7f 45000000000000000000
@dhruvio
dhruvio / CandleChartComponent.elm
Created April 4, 2022 19:53 — forked from NduatiK/CandleChartComponent.elm
Candle Chart with elm-charts
port module CandleStickComponent exposing (..)
import Browser
import Chart as C
import Chart.Attributes as CA exposing (dashed)
import Chart.Events as CE
import Chart.Item as CI
import Chart.Svg as CS
import Html as H exposing (Html, div, span, text)
import Html.Attributes exposing (class)
@dhruvio
dhruvio / coinmarketcap.gs
Created February 21, 2022 02:48
A script to get cryptocurrency price data from CoinMarketCap.
// Be sure to add your CoinMarketCap API key below.
function COINMARKETCAP(token) {
var requestOptions = {
method: 'GET',
qs: {
start: 1,
limit: 5000,
convert: 'USD'
},
headers: {
@dhruvio
dhruvio / nixos-install-hetzner-cloud.sh
Last active July 20, 2020 21:17 — forked from nh2/nixos-install-hetzner-cloud.sh
Script to install NixOS from the Hetzner Cloud NixOS bootable ISO image. Wipes the disk!
#! /usr/bin/env bash
# Script to install NixOS from the Hetzner Cloud NixOS bootable ISO image.
# Wipes the disk!
# Tested with Hetzner's `NixOS 20.03 (amd64/minimal)` ISO image.
#
# Run like:
#
# curl https://nh2.me/nixos-install-hetzner-cloud.sh | sudo bash
#

Installing NixOS on the RockPi4 (B)

The general plan is to build an sd-image-aarch64 from nixpkgs/nixos/modules/installer/cd-dvd/sd-image-aarch64.nix flash it to the eMMC and have the system come up, similar to how this “just works” for raspberry-pis.

The RockPi 4 is a RockChip RK3399 based board, build by radxa with the same formfactor as a rasperry Pi. One noticable difference is that the Rock Pi’s cpu is at the bottom to better allow for the

@dhruvio
dhruvio / RedBlackTree.hs
Created June 5, 2017 01:19 — forked from rampion/RedBlackTree.hs
red-black trees in haskell, using GADTs and Zippers
{-# LANGUAGE GADTs #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE StandaloneDeriving #-}
module RedBlackTree where
data Zero
data Succ n
type One = Succ Zero
data Black
# This isn't meant to be ran as a script, but line-by-line
# Props to Binary (benary.org) for helping me with this
# 0: Create a Scaleway instance and SSH into it
ssh root@...
# 1: Install Nix
adduser user # set a password, doesn't matter what because it's not staying long
adduser user sudo
su -l user
@dhruvio
dhruvio / bloc_technical_assessment.md
Last active August 17, 2016 06:25
bloc_technical_assessment

JavaScript

The bug you've encountered is a tricky one, and it has to do with something called Variable Scoping and Closures. This means that when you define a variable using var, it's important to understand where you can refer to its value, and when its value changes.

What's happening in your code is that the entire for loop is running to completion before any of the buttons are clicked. That means that by the time any of the buttons are clicked, the btnNum variable has a value of 3. Why 3? Because the loop increments btnNum to the first value that btnNum < prizes.length equates to false. So, even though you define the onclick handler each time the loop iterates with a different value for btnNum, the alert(...) statement only runs at the end of

@dhruvio
dhruvio / dokku-redis-container-inspect.json
Created January 19, 2016 02:39
dokku-redis-container-inspect.json
[
{
"Id": "3a19e0b8fd75356728abd16a7a44b67bebbc98efad1df719d6c8b6204f42df64",
"Created": "2016-01-14T07:30:45.986746602Z",
"Path": "/entrypoint.sh",
"Args": [
"redis-server"
],
"State": {
"Status": "running",

Keybase proof

I hereby claim:

  • I am dhruvio on github.
  • I am dhruvio (https://keybase.io/dhruvio) on keybase.
  • I have a public key whose fingerprint is A0A5 1348 D0A8 85CF FB2E E0D1 148C 4058 1F4E CDA3

To claim this, I am signing this object: