Skip to content

Instantly share code, notes, and snippets.

View cbrewster's full-sized avatar

Connor Brewster cbrewster

View GitHub Profile
@cbrewster
cbrewster / AlterPermissionIssue.md
Last active September 3, 2015 21:25
Alter Permission Issue

It looks like the following condition is causing the issue:

!array_key_exists('allow_alter', $attributes)

I feel like this condition should probably still be in place, but some reason the key exists before this point during table creation, which I assume is unintended.

private function verifyPrivilege($attributes) {
    debug_print_backtrace();
    // Making sure alter is set for admin only.
 if($this->isCurrentUserAdmin() && !array_key_exists('allow_alter', $attributes)) {
@cbrewster
cbrewster / MergeSort.swift
Created September 8, 2015 21:14
Merge Sort (Swift)
import Cocoa
var array = [Int](count: 10, repeatedValue: 0)
for var i = 0; i < array.count; i++ {
array[i] = random() % 100
}
func merge(inout array: [Int], p: Int, q: Int, r: Int) {
let len1 = q - p + 1
let len2 = r - q
@cbrewster
cbrewster / Week2.md
Created September 18, 2015 20:17
Programming Other Week 2

Programming Other

Week 2

Double Bit Studios online portal

Screenshots

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 / 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>
[{
"eventId": 847,
"eventSeriesId": 63,
"eventStart": 1478999700,
"eventEnd": 1479002400,
"locationId": 183,
"location": {
"id": 183,
"title": "Davisson Hall",
"latitude": 35.610986877912,

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:

<!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>
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)
}
#[derive(Debug)]
enum TokenKind {
Literal,
Symbol { at_bind: bool },
}
#[derive(Debug)]
struct Token<'a> {
span: &'a str,
kind: TokenKind,