Skip to content

Instantly share code, notes, and snippets.

View cbrewster's full-sized avatar

Connor Brewster cbrewster

View GitHub Profile
trait QueryBindExt {
fn bind_all(self, bindings: Bindings) -> Self;
}
macro_rules! build_binding {
($($type:ty : $name:ident,)*) => {
build_binding!($($type: $name),*);
};
($($type:ty : $name:ident),*) => {
enum Binding {
I64(i64),
String(String),
// Add any type you might bind
}
impl From<i64> for Binding {
fn from(n: i64) -> Self {
Binding::I64(n)
}
#[derive(Debug)]
enum TokenKind {
Literal,
Symbol { at_bind: bool },
}
#[derive(Debug)]
struct Token<'a> {
span: &'a str,
kind: TokenKind,
use std::{collections::HashMap, error, fmt};
pub trait Context {
fn get_binding(&self, name: &str) -> Option<&str>;
}
impl Context for HashMap<String, String> {
fn get_binding(&self, name: &str) -> Option<&str> {
self.get(name).map(|s| &**s)
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>BF Cache</title>
</head>
<body>
<h1>History Discarding Example</h1>
<p>Discarding and reloading documents during traversals breaks the "Fundamental Property" of traversal.</p>
<p>

Keybase proof

I hereby claim:

  • I am cbrewster on github.
  • I am cbrewster (https://keybase.io/cbrewster) on keybase.
  • I have a public key ASBCAmCN7SlHObFeSRuW1RfY4IozvNUUmeCec8u-ds2FZgo

To claim this, I am signing this object:

[{
"eventId": 847,
"eventSeriesId": 63,
"eventStart": 1478999700,
"eventEnd": 1479002400,
"locationId": 183,
"location": {
"id": 183,
"title": "Davisson Hall",
"latitude": 35.610986877912,
@cbrewster
cbrewster / Sampler2D_Crash.html
Created April 1, 2016 01:07
Webpage that crashes Servo
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>WebGL Texture Mipmap</title>
</head>
<body>
<div style="text-align: center">
<canvas id="canvas" width="128" height="128"></canvas>
</div>
private StringBuffer request(String urlString) {
// TODO Auto-generated method stub
StringBuffer chaine = new StringBuffer("");
try{
URL url = new URL(urlString);
HttpURLConnection connection = (HttpURLConnection)url.openConnection();
connection.setRequestProperty("User-Agent", "");
connection.setRequestMethod("POST");
connection.setDoInput(true);
@cbrewster
cbrewster / Week2.md
Created September 18, 2015 20:17
Programming Other Week 2

Programming Other

Week 2

Double Bit Studios online portal

Screenshots