Skip to content

Instantly share code, notes, and snippets.

View AlexFrazer's full-sized avatar
🦊
🦊🦊🦊

Frazer AlexFrazer

🦊
🦊🦊🦊
View GitHub Profile
@AlexFrazer
AlexFrazer / Box.tsx
Last active February 9, 2020 20:31
A basic button component
import styled from "@emotion/styled";
import { shouldForwardProp } from "@styled-system/should-forward-prop";
import {
background,
border,
color,
flexbox,
grid,
layout,
position,
@AlexFrazer
AlexFrazer / EdgeDetector.java
Created November 16, 2012 17:49
Finds edges on pictures
/**
* An imagereader that doesn't look at all like the professors + an edge detector. >.>
* (in my defense, it's mostly reading the API).
* I will use the Sobel's Operator, because I think it's the prettiest and I'm an annoying, pretentious, artist.
* Sobel's operator works by using a 3x3 matrix kinda operation to find the abruptness of change in rgb values.
* Therefore, my strategy will be to use a for loop to iterate through all the pixels and use this operator on all of them.
* Hopefully it works out.
*/
import java.awt.Color;
import axios, { AxiosInstance } from 'axios';
import moment from 'moment';
import * as readline from 'readline';
const FIELDS = ['applicant', 'location', 'DayOrder', 'start24', 'end24'];
const serializeFields = (fields: string[]) =>
fields.map(field => `\`${field}\``).join(',');
const range = (start: number, end: number) =>
import * as React from 'react';
import * as rbush from 'rbush';
import * as PropTypes from 'prop-types';
export interface Props {
/* +/- how many pixels from mousedown */
tolerance: number;
/* What to do on selection */
onSelection(o: { selection: Set<string>, e: React.MouseEvent<HTMLDivElement> }): void;
/* What to do when selection has been completed */
import click
from flask.cli import AppGroup
@click.command(cls=AppGroup)
def cli():
" Manage the regions "
@cli.command()
@click.argument('region_id')
def broadcast_weather_report(region_id):
/* eslint-disable */
declare module 'react-window' {
import { Requireable, Validator } from 'prop-types';
export type Direction = 'vertical' | 'horizontal';
export type Alignment = 'auto' | 'center' | 'end' | 'start';
export type RenderProps<TDataType extends any = any> = {
key?: string;
data?: TDataType;
import * as React from 'react';
import { InfiniteLoader, AutoSizer, GridProps, Dimensions, IndexRange, Index } from 'react-virtualized';
import ProductLoader from './ProductLoader';
import ProductFilters from './ProductFilters';
export interface Props extends GridProps {
limit: number;
cardWidth: number;
cardHeight: number;
padding: number;
import cssnano from 'cssnano';
import simplevars from 'postcss-simple-vars';
import nested from 'postcss-nested';
import cssnext from 'postcss-cssnext';
import postcssModules from 'postcss-modules';
import tslint from 'rollup-plugin-tslint';
import uglify from 'rollup-plugin-uglify';
import postcss from 'rollup-plugin-postcss';
import replace from 'rollup-plugin-replace';
import commonjs from 'rollup-plugin-commonjs';
import * as React from 'react';
import { findDOMNode } from 'react-dom';
type Props = {
selectableKey: any,
children?: React.ReactNode,
};
/**
* Wraps an element inside of a SelectableGroup and makes it possible to select
import * as React from 'react';
import 'lib/jwplayer-7.7.4/jwplayer.js';
interface Props extends SetupConfig, Events {};
interface EventMap {
[name: string]: (e: any) => void,
}
export default class ShiftPlayer extends React.Component<Props, {}> {