Skip to content

Instantly share code, notes, and snippets.

View dhruvio's full-sized avatar

Dhruv Dang dhruvio

View GitHub Profile
@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 / 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