Skip to content

Instantly share code, notes, and snippets.

View prescod's full-sized avatar

Paul Prescod prescod

View GitHub Profile
@prescod
prescod / Datepicker.js
Created March 26, 2019 04:09
Datepicker issues.
/* eslint-disable no-console, react/prop-types */
import React, { Component, useState } from 'react';
import logo from './logo.svg';
import './App.css';
import {IconSettings, Datepicker, Button} from '@salesforce/design-system-react';
class Example extends React.Component {
static displayName = 'DatepickerExample';
constructor(props) {
@prescod
prescod / Type signature
Created March 25, 2019 16:38
Type signature from Flow and React
{|+AbstractComponent: type AbstractComponent<-Config, +Instance = mixed> = React$AbstractComponent<Config, Instance>, +Children: {+count: (children: ChildrenArray<any>) => number, +forEach: <T>(children: ChildrenArray<T>, fn: (child: T, index: number) => mixed, thisArg?: mixed) => void, +map: <T, U>(children: ChildrenArray<T>, fn: (child: $NonMaybeType<T>, index: number) => U, thisArg?: mixed) => Array<$NonMaybeType<U>>, +only: <T>(children: ChildrenArray<T>) => $NonMaybeType<T>, +toArray: <T>(children: ChildrenArray<T>) => Array<$NonMaybeType<T>>}, +ChildrenArray: type ChildrenArray<+T> = $ReadOnlyArray<ChildrenArray<T>> | T, +Component: class React$Component<Props, State = void>, +ComponentType: type ComponentType<-P> = React$ComponentType<P>, +ConcurrentMode: ({children: ?React$Node}) => React$Node, +Config: type Config<Props, DefaultProps> = React$Config<Props, DefaultProps>, +Context: type Context<T> = React$Context<T>, +DOM: any, +Element: type Element<+C> = React$Element<C>, +ElementConfig: type Elemen
@prescod
prescod / MissingFilters.py
Created March 14, 2019 23:50
Weird filter attribute missing bug
import django_filters
class Xyzzy:
myfilter = django_filters.rest_framework.ChoiceFilter()
print(myfilter)
print(Xyzzy.myfilter)
class Xyzzy(django_filters.rest_framework.FilterSet):
myfilter = django_filters.rest_framework.ChoiceFilter()
{
"metadata": {
"name": "",
"signature": "sha256:0843cdf949229008d5c2362c84a6d66cb70da9a0f72079a98cbeb0efe7c7404b"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
fesfesfesfef
fesfejiofjeisf
xyzzy