Skip to content

Instantly share code, notes, and snippets.

View openbrian's full-sized avatar
I fight for the users.

Brian DeRocher openbrian

I fight for the users.
View GitHub Profile
@openbrian
openbrian / get_dict_item.py
Created April 21, 2021 13:59
Dictionary incompatible types
from typing import Dict, TypeVar
from returns.curry import partial
from returns.result import Failure, Success, Result
T = TypeVar("T")
def get_dict_item(needle: str, haystack: Dict[str, T]) -> Result[T, str]:
@openbrian
openbrian / wikipedia-color-palette.soc
Created November 11, 2020 14:50
wikipedia colors
<?xml version="1.0" encoding="UTF-8"?>
<office:color-table
xmlns:office="http://openoffice.org/2000/office"
xmlns:style="http://openoffice.org/2000/style"
xmlns:text="http://openoffice.org/2000/text"
xmlns:table="http://openoffice.org/2000/table"
xmlns:draw="http://openoffice.org/2000/drawing"
xmlns:fo="http://www.w3.org/1999/XSL/Format"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:dc="http://purl.org/dc/elements/1.1/"
@openbrian
openbrian / README.md
Last active October 20, 2019 16:39
rake database dependency

task dependency diagram for active-record-5.2.3/lib/active_record/railties/database.rake.

All dependencies on load_config, check_protected_environments, and environment are omitted because they are numerous and distort the diagram.

black lines are dependencies gray lines are invocations, where these are obvious (like calling a .invoke method).

MVCS PTA Resource Booklet for Parents

Practical Ideas for Supporting Spanish Learning at Home

MOUNT VERNON COMMUNITY SCHOOL
2601 Commonwealth Avenue
Alexandria, VA 22305
@openbrian
openbrian / overpass.geojson
Last active February 10, 2019 21:30
data exported by overpass turbo 2
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@openbrian
openbrian / rectangle_with_relative_hole.svg
Created February 10, 2019 00:25
Simple SVG with a hole in it, using relative path coordinates
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@openbrian
openbrian / gherkin.xml
Created February 22, 2018 18:20
Gherkin syntax highlighting for KWrite, Kate, KDevelop
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE language SYSTEM "language.dtd">
<!-- Gherkin, syntax definition based on sql-postgresql.xml by Yury Lebedev -->
<language name="Gherkin" version="0.1" kateversion="2.4" section="Other" extensions="*.feature;*.FEATURE" mimetype="text/x-gherkin" casesensitive="0" author="Brian DeRocher (brian@derocher)" license="GPL">
<highlighting>
<list name="keywords">
<item> FEATURE: </item>
<item> SCENARIO: </item>
<item> SCENARIO OUTLINE: </item>
<item> BACKGROUND: </item>
@openbrian
openbrian / JsonFileDataProviderIterator.php
Last active April 4, 2017 17:52 — forked from jehoshua02/JsonFileDataProviderIterator.php
JsonFileDataProviderIterator class for use with PHPUnit @dataProvider annotation.
<?php
class JsonFileDataProviderIterator implements Iterator
{
protected $position = 0;
protected $array;
public function __construct($test, $namespace)
{
$path = preg_replace('/.php$/', '.data', $test) . '/' . $namespace;
<html>
<head>
<style>
/* TODO: Collapse the borders. */
/* counts */
.c { border: 0px solid black; width: 30px; height: 25px; text-align: right; padding-left: 3px; padding-right: 3px;}
/* empty cells */
.e { border: 0px solid black; width: 30px; height: 25px;}
/* republican */
.r { border: 1px solid red; width: 25px; height: 25px; }
@openbrian
openbrian / overpass.geojson
Created November 13, 2015 21:09 — forked from anonymous/overpass.geojson
data exported by overpass turbo
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.