Skip to content

Instantly share code, notes, and snippets.

View benbayard's full-sized avatar

Ben benbayard

View GitHub Profile
/**
* Lazily evaluate a deeply nested value
* @param {() => T} getterFn A function that when called either throws an error or returns a value
* @param {T} [defaultValue] A value to return if getterFn does not return a value or the value it returns is undefined
* @returns {T}
* @template T
*/
export function get(getterFn, defaultValue) {
try {
const value = getterFn()
HTTP/1.1 200 OK
Date: Tue, 03 Sep 2019 18:11:57 GMT
Server: Apache
Strict-Transport-Security: max-age=63072000; includeSubdomains;
X-Frame-Options: SAMEORIGIN
X-Content-Type-Options: nosniff
Referrer-Policy: same-origin
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
devx-web.service Traceback (most recent call last):
devx-web.service File "/opt/code/patreon_py/venv/lib/python3.7/site-packages/flask/app.py", line 2446, in wsgi_app
devx-web.service response = self.full_dispatch_request()
devx-web.service File "/opt/code/patreon_py/venv/lib/python3.7/site-packages/flask/app.py", line 1951, in full_dispatch_request
devx-web.service rv = self.handle_user_exception(e)
devx-web.service File "/opt/code/patreon_py/venv/lib/python3.7/site-packages/ddtrace/vendor/wrapt/wrappers.py", line 603, in __call__
devx-web.service args, kwargs)
devx-web.service File "/opt/code/patreon_py/venv/lib/python3.7/site-packages/ddtrace/contrib/flask/helpers.py", line 20, in wrapper
devx-web.service return func(pin, wrapped, instance, args, kwargs)
devx-web.service File "/opt/code/patreon_py/venv/lib/python3.7/site-packages/ddtrace/contrib/flask/helpers.py", line 29, in wrapper
import { config } from '../config'
import { start, login } from '../flows/login'
context('Logging in to an existing account', () => {
beforeEach(() => start())
it('should load the page', () => {
login(
config.params.creatorLogin.user,
config.params.creatorLogin.password,
import { Forbidden, Router, Route } from 'react-express'
function App() {
return (
<Router>
<Route path="/api">
<Route path="/todos">
<Route path="/:id">{({id}) => <FetchTodo id={id} />}</Route>
</Route>
</Route>
import ReactTest, {
DescribeReactComponent,
WhenTheComponentIsMounted,
TheComponentsStateDoesNotExist,
TheComponentsStateDoesNotExist,
TheComponentHasElement,
WhenTheComponentIsClicked,
TheComponentHasStateLike,
TheComponentHasText
} from "react-test"; // to be named of course.
// Sexy mixin for margin/padding
@mixin postfix-spacer($side, $size) {
%#{ $pre }-#{$type}-#{$side} {
#{$type}-#{$side}: $size;
}
}
@mixin spacing-with-modifiers($spacing: 10px, $type: "margin", $pre: "mar") {
%#{$pre}-#{$type} {
(function($) {
function dumpTag() {
var oldTag = this.tagName;
var $newTag = $(this).addClass("mw-was-" + oldTag.toLowerCase());
$newTag.replaceWith(function() {
var attributes = "";
$.each($newTag[0].attributes, function(i, attr) {
// toEl.attr(attr.name, attr.value);
attributes = attributes + " " + attr.name + '="' + attr.value + '"';
});
{
"goto": "",
"show_blocks": [
"ddate-container",
"shipping-method-container"
],
"update_blocks": {
"checkout-shipping-load": "<div id=\"shipping-addresses-container\">\n <div class=\"step-subtitle\">\n <h3>Shipping Address<\/h3>\n <\/div>\n <div class=\"address-item shipping-address-item highlight\" id=\"shipping-address-item-0\">\n <div class=\"address-button\">\n <input type=\"radio\" id=\"shipping-address-select0\"\n name=\"shipping_address_select\"\n value=\"0\"\n onchange=\"selectShippingAddress(0);\"\n checked=\"checked\" \/>\n <\/div>\n <div class=\"address-info shipping-address-info\" id=\"shipping-address-info0\">\n Ben Bayard, 3916 Alta Vista Cir San Francisco, Pittsburg, California 94565-5782, United States
@benbayard
benbayard / FUGGINDOTS.scss
Last active August 29, 2015 14:00
More Sexy Sass
%dot {
border: {
radius: 100%;
}
background: $body-background-color;
}
@mixin make-dot($size) {
height: $size;
width: $size;