Skip to content

Instantly share code, notes, and snippets.

View Fishbiscuit's full-sized avatar

Hum Qing Ze Fishbiscuit

View GitHub Profile
@Fishbiscuit
Fishbiscuit / TrustFund.sol
Created October 22, 2021 08:31
TrustFund code
pragma solidity ^0.5.9;
// Adding only the ERC-20 function we need
interface DaiToken {
function transfer(address dst, uint wad) external returns (bool);
function balanceOf(address guy) external view returns (uint);
}
contract owned {
DaiToken daitoken;
address owner;
╔══════════╦════════════╦═════════╗
║ Category ║ Total Time ║ % spent ║
╠══════════╬════════════╬═════════╣
║ Sleep ║ 22d15h47m ║ 27.1 ║ 32,627m
║ Rest ║ 21d6h22m ║ 25.4 ║ 30,622m
║ SUTD ║ 12d8h57m ║ 14.8 ║ 17,817m
║ Tribe ║ 14d3h5m ║ 16.9 ║ 20,345m
║ Social ║ 9d14h13m ║ 11.5 ║ 13,813m
║ Work ║ 1d10h35m ║ 1.7 ║ 2,075m
║ News ║ 22h45m ║ 1.1 ║ 1,365m
╔══════════╦════════════╦═════════╗
║ Category ║ Total Time ║ % spent ║
╠══════════╬════════════╬═════════╣
║ Sleep ║ 26d15h55m ║ 27.6 ║ 38,395m
║ Rest ║ 19d23h53m ║ 20.7 ║ 28,793m
║ SUTD ║ 14d21h42m ║ 15.5 ║ 21,462m
║ Tribe ║ 13d16h29m ║ 14.2 ║ 19,709m
║ Social ║ 8d30m ║ 8.3 ║ 11,550m
║ Work ║ 7d11h39m ║ 7.7 ║ 10,779m
║ Meeting ║ 3d3h31m ║ 3.3 ║ 4,531m
╔══════════╦════════════╦═════════╗
║ Category ║ Total Time ║ % spent ║
╠══════════╬════════════╬═════════╣
║ Sleep ║ 25d14h10m ║ 26.6 ║
║ SUTD ║ 15d8h48m ║ 16 ║
║ Rest ║ 8d9h7m ║ 9 ║
║ Social ║ 7d6h55m ║ 8 ║
║ Work ║ 6d9h32m ║ 7 ║
║ Meeting ║ 2d17h36m ║ 3 ║
║ Learn ║ 1d17h3m ║ 2 ║
@Fishbiscuit
Fishbiscuit / AE.R
Last active December 13, 2019 05:01
library(tm)
library(SnowballC)
library(caTools)
library(rpart)
library(rpart.plot)
library(randomForest)
library(dplyr)
library(adabag)
library(stringr)
# simple implementation that checks for discrepancies in climate reporting
import csv
import sys
# csv_file = "test.csv"
header = {"population": "none", "baseline_emissions": "none", "baseline_year": "none",
"total_co2_emissions": "none", "total_co2_emissions_year": "none"}
@Fishbiscuit
Fishbiscuit / machine.js
Last active December 1, 2019 08:01
Generated by XState Viz: https://xstate.js.org/viz
const checkpointStates = {
initial: 'wait',
states: {
wait: {
after: {
1000: 'speakToOfficer'
}
},
speakToOfficer: {
after: {
@Fishbiscuit
Fishbiscuit / machine.js
Last active November 4, 2019 07:31
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions

Keybase proof

I hereby claim:

  • I am fishbiscuit on github.
  • I am fishbiscuit (https://keybase.io/fishbiscuit) on keybase.
  • I have a public key ASCdVzSRoYfLPEjsy72ECM0cOfOMxBUGtrhL3NI2cpIsQwo

To claim this, I am signing this object:

@Fishbiscuit
Fishbiscuit / machine.js
Last active July 31, 2019 10:00
Generated by XState Viz: https://xstate.js.org/viz
const promiseMachine = Machine({
id: 'promise',
initial: 'Request_Received',
states: {
Request_Received: {
on: {
// state transition (shorthand)
// this is equivalent to { target: 'resolved' }
RESOLVE: 'Booking_Tool',