Skip to content

Instantly share code, notes, and snippets.

View jonahwilliams's full-sized avatar

Jonah Williams jonahwilliams

View GitHub Profile
use std::collections::VecDeque;
use std::collections::HashSet;
use std::hash::{Hash, Hasher};
use std::time::Instant;
fn main() {
let start = Instant::now();
let result = bfs(Board3::new(vec![0, 2, 5, 6, 8, 3, 4, 7, 1]));
let elapsed = start.elapsed();
println!("{:?}", elapsed);
use std::collections::VecDeque;
use std::collections::HashSet;
use std::hash::{Hash, Hasher};
use std::time::Instant;
fn main() {
let start = Instant::now();
let result = bfs(Board3::new(vec![0,2,5,6,8,3,4,7,1]));
let elapsed = start.elapsed();
println!("{:?}", elapsed);
@jonahwilliams
jonahwilliams / System Design.md
Created March 22, 2017 00:59 — forked from vasanthk/System Design.md
System Design Cheatsheet

#System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

##Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
@jonahwilliams
jonahwilliams / main.rs
Created March 29, 2017 05:29
elm in rust?
fn main() {
println!("Hello, world!");
use Template::*;
enum Action {
Increment,
Decrement,
}
let mut foo: Widget<i32, _, _, Action> = Widget {
<template id="template">
<style>
:host {
display: flex;
flex-direction: column;
background-color: red;
width: 100px;
height: 100px;
justify-content: flex-start;
align-items: center;
@jonahwilliams
jonahwilliams / index.js
Created October 23, 2017 05:59
incrmental-dom-example
// import {
// elementOpen,
// elementClose,
// elementVoid,
// text,
// patch,
// } from 'incremental-dom';
'use strict';
@jonahwilliams
jonahwilliams / flutterprob.dart
Last active March 6, 2018 02:51 — forked from patientplatypus/flutterprob.dart
Having trouble updating passed variable in flutter
class NavigationState extends State<MyNavigationHolder> {
var goToPass = "/page1";
assignPass(page) {
print("inside assignPass");
print("value of page: " + page);
setState(() {goToPass = page;});
}
class ParentWidget extends StatefulWidget {
const ParentWidget({Key key}) : super(key: key);
@override
State createState() => new ParentState();
}
class ParentState extends State<ParentWidget> {
import 'package:flutter/material.dart';
void main() => runApp(new MyApp());
class MyApp extends StatelessWidget {
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return new MaterialApp(
title: 'Flutter Demo',
import 'package:flutter/material.dart';
void main() => runApp(new MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return new MaterialApp(
title: 'Flutter Demo',
theme: new ThemeData(