Skip to content

Instantly share code, notes, and snippets.

View justinmeiners's full-sized avatar

Justin Meiners justinmeiners

View GitHub Profile
@justinmeiners
justinmeiners / sample_net.net
Created February 5, 2019 03:49
Sample of hosting a Neural Net in a gist.
fAEBABAAEgDgAAoBAQAAAAEABQAAAAEAAQBOAdwABAAAAAQAAAAAAAEAAAACAAAAAwAAAAEACADmAMQAAQAAAAEABAAAAAEAAADmAEYBAQAAAAEABgAAAAEAAgDqAJIBAQAAAAEABwAAAAEAAwByAP8AAAAAAAAABAAEAAUABgAHAIIB4AABAAAAAQAIAAAAAQAJAMUB4AABAAAAAQAJAAAAAQAKAPwB4gABAAAAAQAKAAAAAQALAP0BFgEBAAEAAQALAAAAAQAMAMQBGAEBAAEAAQAMAAAAAQANAIMBGgEBAAEAAQANAAAAAQAOAIYBUgEBAAAAAQAOAAAAAQAPAMIBUQEBAAAAAQAPAAAAAQAQAAACTwEBAAAAAQAQAAAAAQARAGwC9QABAAAAAQARAAAAAAACAAEAAAABAAMAAQAEAAEABQACAAUAAAAFAAMABQAEAAEABgAGAAcABwAIAAgACQAJAAoACgALAAsADAAMAA0ADQAOAA4ADwA=
python -m json.tool
@justinmeiners
justinmeiners / downloader.js
Last active November 28, 2018 21:06
Delegate example.
// notice that downloader doesn't need to import user interface
class Downloader {
// delegate has startDownload and finishDownload
constructor(delegate) {
this.delegate = delegate;
}
downloadFile() {
@justinmeiners
justinmeiners / crypto.md
Last active June 16, 2019 04:07
Cryptocurrency Notes

Security

Technology is never the root of system security. Technology is a tool to help people secure what they value. Security requires people to act.

The way to beat the $5 wrench attack is to bear arms. Either your own, or employ guards, or use a safety deposit box, or rely on the police forces and army; or whatever may be appropriate and proportionate in your situation. If someone physically overpowers you then no technology on Earth can save your bitcoins.

@justinmeiners
justinmeiners / write_struct.c
Created October 30, 2018 03:28
How to copy a struct into a byte buffer.
// how to write a struct to a buffer.
typedef struct {
int version;
int count;
char id[8];
} FileInfo;
FileInfo info;
@justinmeiners
justinmeiners / learn_you_a_haskell.md
Last active April 3, 2019 21:47
My notes from reading "Learn You a Haskell for Great Good". I needed to crunch some haskell for a work project.

Learn You a Haskell Notes

Learn You a Haskell For Great Good

I tried going through this book a few times when I was younger, but lacked the mathematical knowledge to understand a lot of what was going on. Now the functional ideas and type system are a breeze but lazinesss is still very new and mysterious.

Haskell Overview

Referential transparency: if a function is called multiple times with the same inputs, it will produce the same outputs.

@justinmeiners
justinmeiners / teaching_python.py
Last active September 15, 2018 05:23
Examples from python lessons I taught.
# Created By: Justin Meiners (2017)
# simple calculations
# -------------------------------
import math
def volume_cone(radius, height):
volume = math.pi * (radius**2.0) * (height / 3.0)
return volume
@justinmeiners
justinmeiners / dutch_auction.sol
Last active September 15, 2018 05:53
Dutch auction smart contract for a presentation.
// Created By: Justin Meiners (2018)
pragma solidity ^0.4.24;
// https://en.wikipedia.org/wiki/Dutch_auction
contract DutchAuction {
uint public askingPrice;
address public auctioneer;
address public winner;
address public seller;
@justinmeiners
justinmeiners / parenscript-first-trial.lisp
Created July 15, 2018 01:41
Playing around with ParenScript.
; ParenScript experiment
; https://common-lisp.net/project/parenscript/reference.html
; https://gitlab.common-lisp.net/parenscript/parenscript
; typical functions
(defun fib (n)
(cond ((= n 0) 0)
((= n 1) 1)
(t (+ (fib (- n 1)) (fib (- n 2))))))