Skip to content

Instantly share code, notes, and snippets.

View laboon's full-sized avatar

Bill Laboon laboon

View GitHub Profile
@laboon
laboon / pep9p1.hs
Created November 9, 2012 22:26
Project Euler - Problem 9 - Part 1
[ (a,b,c) | c <- [1..], b <- [1..c], a <- [1..b], a^2 + b^2 == c^2, a + b + c == 1000]
jQuery ($) ->
$(".span_lesson_dropdown").click ->
if $(".row_select_lesson").hasClass "lesson_visible"
console.log "is vis"
$(".row_select_lesson").slideUp()
$(".span_lesson_dropdown").text = "\/"
else
console.log "not vis"
$(".row_select_lesson").slideDown()
$(".span_lesson_dropdown").text = "/\"
@laboon
laboon / teaching-philosophy.md
Last active September 21, 2021 15:05
Bill's Teaching Philosophy

Eustress over distress

Learning is by definition a "stressful" experience, in that obtaining new knowledge stresses the brain. However, there's a difference between eustress ("good stress", e.g. doing a Sudoku puzzle) and distress ("bad stress", e.g., being yelled at by your boss). Constant bad stress especially decreases your ability to learn, but is actually beneficial in small doses. See this Nature article for a good overview: https://www.nature.com/articles/npjscilearn201611 There have also been studies that taking mini-breaks from stress when learning help improve retention: https://www.ninds.nih.gov/News-Events/News-and-Press-Releases/Press-Releases/Want-learn-new-skill-Take-some-short-breaks

I try not to make my lectures or explanations too dense, and make random digressions to provide a "mental break". For instance, in my software engineering classes, when I discuss how sometimes the best code is no code, I'll do a quick talk about Arthur Schopenhauer's philosophy of antinatalism ("th

@laboon
laboon / workshop-commands.md
Created May 23, 2019 18:40
Commands for Substrate Workshop, "Build Your Own Blockchain With Substrate"

Run the default initial blockchain

./target/debug/node-template
--base-path /tmp/alice
--chain=local
--key //Alice
--port 30333
--telemetry-url ws://telemetry.polkadot.io:1024
--validator
--name AlicesNode

@laboon
laboon / substrate-workshop-commands.md
Last active September 13, 2022 10:16
Commands for "Build Your Own Blockchain with Substrate"

Setup Instructions

git clone https://github.com/paritytech/substrate
cd substrate/node-template
git checkout 53df5619c0273ef226ed9a470ca863d212ac917c
./scripts/init.sh
./scripts/build.sh
cargo build
cd ..
@laboon
laboon / gist:dd51b76fd1518025bbf2191b6ad3f108
Created June 6, 2019 18:03
Full error path for java api - 06_make_transfer.sh
(1116) ~/web3/api/examples_runnable/20190601 $ ./06_make_transfer.sh
/Users/laboon/web3/api/examples_runnable/20190601
load
connect to endpoint [ws://127.0.0.1:9944]
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
@laboon
laboon / gist:192d916b47122b67e552c1006e9804ef
Last active June 11, 2019 14:11
Validator workshop commands
# Validator Workshop Commands and Links
This will contain all of the instructions for the Polkadot Validator workshop.
Slides: https://docs.google.com/presentation/d/1HCBgya-KWCjCEHYtxSFJ3lSz9U22Bs-8vMuA4C2VRzw/
## Terms
What is a Validator? https://wiki.polkadot.network/en/latest/polkadot/node/node-operator/
c = 0;
x = document.getElementsByClassName("mx_MemberDeviceInfo_verify");
f = () => {
if (c < x.length) {
x[c++].click();
timer = setTimeout(() => {
document.getElementsByClassName("mx_linkButton")[0].click();
timer2 = setTimeout(() => {
document.getElementsByClassName("mx_Dialog_primary")[0].click();
timer = setTimeout(f, 0);
# Polkadot Governance Workshop
## Connecting the Polkadot UI
https://polkadot.js.org/apps/#/
Go to Settings -> Custom Endpoint
In "remote node/endpoint to connect to", type `ws://127.0.0.1:9944/` (note: will change!)