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:
// require() some stuff from npm (like you were using browserify) | |
// and then hit Rebuild to run it on the right | |
var q = require("qwery"), | |
b = require("bonzo"); | |
b(q("body")).html("hello"); |
I hereby claim:
To claim this, I am signing this object:
[ | |
{ | |
"Id": "3a19e0b8fd75356728abd16a7a44b67bebbc98efad1df719d6c8b6204f42df64", | |
"Created": "2016-01-14T07:30:45.986746602Z", | |
"Path": "/entrypoint.sh", | |
"Args": [ | |
"redis-server" | |
], | |
"State": { | |
"Status": "running", |
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
# 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 |
{-# LANGUAGE GADTs #-} | |
{-# LANGUAGE RankNTypes #-} | |
{-# LANGUAGE StandaloneDeriving #-} | |
module RedBlackTree where | |
data Zero | |
data Succ n | |
type One = Succ Zero | |
data Black |
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
#! /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 | |
# |
// Be sure to add your CoinMarketCap API key below. | |
function COINMARKETCAP(token) { | |
var requestOptions = { | |
method: 'GET', | |
qs: { | |
start: 1, | |
limit: 5000, | |
convert: 'USD' | |
}, | |
headers: { |
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) |