Skip to content

Instantly share code, notes, and snippets.

View martinmckenna's full-sized avatar
🤔
this is dumb who looks at these???

Marty martinmckenna

🤔
this is dumb who looks at these???
View GitHub Profile
import * as React from 'react'
import TextField, { Props as TextFieldProps } from 'src/TextField'
type Props = TextFieldProps & {
hideHelperText?: boolean;
};
class PasswordInput extends React.Component<Props> {
onChange = (e: React.ChangeEvent<HTMLInputElement>) => {
/** do stuff */
import React from "react";
import { shallow, mount } from "enzyme";
import { Checklist } from "./ChecklistClassComponent";
import Enzyme from "enzyme";
import Adapter from "enzyme-adapter-react-16";
Enzyme.configure({ adapter: new Adapter() });
const mockItems = [
{
@martinmckenna
martinmckenna / fetch.ts
Last active February 7, 2019 15:00
Data Fetching with Hooks and Axios Cancellable Requests
import React, { useEffect, useState } from 'react';
import Axios from 'axios'
/**
* returns an object which contains
* both the fetch request
* and the function that will cancel the in-flight request
*/
const fetchData = () => {
const source = Axios.CancelToken.source();
@martinmckenna
martinmckenna / cocktails.py
Created January 14, 2019 01:46
many to many cocktails ingredients
from flask import Flask
from settings import db, ma
from models.ing_in_cocktails import CocktailIngredient, CocktailIngredientSchema
from models.ingredients import Ingredient, IngredientSchema
class Cocktail(db.Model):
__tablename__ = 'cocktails'
id = db.Column(db.Integer, primary_key=True)
name = db.Column(db.String(80), nullable=False)
@martinmckenna
martinmckenna / sa-dark-theme.css
Created September 28, 2018 01:35
SA Dark Theme
html, div#container, .post tbody .bbc-block:not(.userquoted), td.title div.lastseen, #forum td.title div.lastseen a.x, table.standard td, .dictionary_show .letternav li a, .gloryhole div#main_small table.stats td, ul.contactlist {
background: #3b444b !important;
}
#content ul#usercpnav {
background: transparent !important;
box-shadow: none;
border: none;
}
133 passing (970.00s)
11 skipped
14 failing
1) Create Linode - Clone from Existing Suitesuite1 should fail to clone to a smaller linode plan:
Failed: Cannot read property 'includes' of undefined
running chrome
at <Jasmine>
at UserContext.it (/Users/mmckenna/code/manager/e2e/specs/create/clone-from-existing-linode.spec.js:40:28)
at <Jasmine>
@martinmckenna
martinmckenna / vipTest.js
Last active June 16, 2017 01:32
Test for VIP
//Write a program that allows for an integer array to be passed in and will then output all of the pairs that sum up to 10.
//Please provide a solution that allows for 1) output all pairs (includes duplicates and the reversed ordered pairs),
//2) output unique pairs only once (removes the duplicates but includes the reversed ordered pairs),
//and 3) output the same combo pair only once (removes the reversed ordered pairs).
//find pairs of ints that add to 10
const pairsSumToTen = function getPairs(arrayOfInts) { //takes an array of ints as an argument
let result = []; //used for every pair of numbers that add to ten
for (i = 0; i < arrayOfInts.length; i++) { //map over the array