Skip to content

Instantly share code, notes, and snippets.

View lrowe's full-sized avatar

Laurence Rowe lrowe

  • San Francisco, CA
View GitHub Profile
@lrowe
lrowe / Cargo.lock
Last active September 12, 2023 06:01
sharded-slab-reserved-bits-bug
# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
version = 3
[[package]]
name = "lazy_static"
version = "1.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"
@lrowe
lrowe / import_map.json
Last active March 23, 2022 20:31
Non-working attempt to enable shared cache in deno-sqlite. See https://github.com/dyedgreen/deno-sqlite/issues/187
{
"imports": {
"https://deno.land/x/sqlite@v3.3.0/build/sqlite.js": "./sqlite.js"
}
}
@lrowe
lrowe / test_tutorial.py
Created February 23, 2016 19:29
Pytest adaption of Pyramid tutorial tests
# Adapted from https://github.com/Pylons/pyramid/blob/1.6.1/docs/quick_tutorial/json/tutorial/tests.py
import pytest
# View tests
@pytest.yield_fixture
def config():
from pyramid import testing
"*":
"exception-reporting":
userId: "xxx"
welcome:
showOnStartup: false
linter: {}
core:
themes: [
"one-dark-ui"
"monokai"
@lrowe
lrowe / debug-zodb-bloat.rst
Created August 6, 2015 21:59
Debugging ZODB bloat [2005]

Warning

This was written in 2005 so may be out of date. Originally published on the old Plone documentation section: https://plone.org/documentation/kb-old/debug-zodb-bloat/

About

Having spent a lot of time tracking down the cause of ZODB bloat in an Archetypes application I thought I'd share my experience in case it was useful to anyone else.

Step 1: Analysis

# ami-5189a661 14.04
# ec2 role backfill-instance
packages:
- python3-dev
- python-virtualenv
power_state:
mode: poweroff
import gc
closed = False
def generator(iterable, held=None):
global closed
try:
for chunk in iterable:
yield chunk
except GeneratorExit:
@lrowe
lrowe / example.py
Last active August 29, 2015 14:24 — forked from sigmavirus24/example.py
import gc
closed = False
def generator(iterable):
global closed
try:
for chunk in iterable:
yield chunk
except GeneratorExit:
@lrowe
lrowe / index.html
Last active August 29, 2015 14:19
Fixed React script content update on ie8 with patch from facebook/react#2311
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Fixed script content update on ie8</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/es5-shim/4.1.1/es5-shim.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/es5-shim/4.1.1/es5-sham.js"></script>
<script src="https://cdn.rawgit.com/paulmillr/console-polyfill/master/index.js"></script>
<script src="react-with-addons.js"></script>
</head>
#!/bin/bash
if [ -z "${SAUCE_USERNAME}" ] || [ -z "${SAUCE_ACCESS_KEY}" ]; then
echo "This script can't run without your Sauce credentials"
echo "Please set SAUCE_USERNAME and SAUCE_ACCESS_KEY env variables"
echo "export SAUCE_USERNAME=ur-username"
echo "export SAUCE_ACCESS_KEY=ur-access-key"
exit 1
fi
SAUCE_TMP_DIR="$(mktemp -d -t sc.XXXX)"