Skip to content

Instantly share code, notes, and snippets.

View kevinashworth's full-sized avatar
🏠
Working from home

Kevin Ashworth kevinashworth

🏠
Working from home
View GitHub Profile
@kevinashworth
kevinashworth / keybindings.json
Created October 19, 2021 14:30
VSCode Keyboard Shortcuts - for macOS - swap Command+Number with Control+Number
[
{
"key": "ctrl+1",
"command": "workbench.action.focusFirstEditorGroup"
},
{
"key": "cmd+1",
"command": "-workbench.action.focusFirstEditorGroup"
},
{
import React, { useState } from 'react';
import Box from '@material-ui/core/Box';
import Button from '@material-ui/core/Button';
import FormControl from '@material-ui/core/FormControl';
import InputLabel from '@material-ui/core/InputLabel';
import MenuItem from '@material-ui/core/MenuItem';
import Select from '@material-ui/core/Select';
import Typography from '@material-ui/core/Typography';
import FilterListIcon from '@material-ui/icons/FilterList';
import { makeStyles } from '@material-ui/styles';
Date: Sat, 31 Jul 2021 09:05:48 -0700
Subject: [PATCH] Declare classes in a component rather than pass them as props
---
src/pages/TagCreator/TopicTagSection.js | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/src/pages/TagCreator/TopicTagSection.js b/src/pages/TagCreator/TopicTagSection.js
index 3c92fd4..fb8d29a 100644
--- a/src/pages/TagCreator/TopicTagSection.js
import React from 'react';
import { makeStyles } from '@material-ui/core/styles';
import Box from '@material-ui/core/Box';
import Container from '@material-ui/core/Container';
import Grid from '@material-ui/core/Grid';
import NavBreadcrumbs from './NavBreadcrumbs';
import TitleSection from './TitleSection';
const useStyles = makeStyles({
addPad: {
import React from 'react';
const SettingsGearIcon = () => {
return (
<svg
width='23'
height='24'
viewBox='0 0 60 64'
>
<path
@kevinashworth
kevinashworth / cypress-rsv.js
Last active November 16, 2020 20:17
Cypress command to select an option when using react-select-virtualized
// declare in commands.js
Cypress.Commands.add('chooseRSVOption', (selector, option) => {
const re = new RegExp(`^${option}$`) // exact match
cy.get(`${selector} .react-select-virtualized input`)
.click({ force: true })
.type(option)
.get('.fast-option')
.contains(re)
.click()
@kevinashworth
kevinashworth / sw.js
Created March 19, 2020 17:48
Shortwave plus gs
SISW();
function SISW() {
var t = window.getSelection
? window.getSelection()
: (
document.getSelection
? document.getSelection()
: (
document.selection
? document.selection.createRange().text
/* Bookmarklet to Google Search the current site for a word or phrase. WIP. */
// h = location.href;
// url = new URL(h);
// tld = url.host;
// qs = prompt('Google Search on this site for:');
// gs = `https://www.google.com/search?q=site%3A${tld}+${qs}`;
// window.location = gs;
javascript:h%20=%20location.href;url%20=%20new%20URL(h);tld%20=%20url.host;qs%20=%20prompt(%27Google%20Search%20on%20this%20site%20for:%27);gs%20=%20`https://www.google.com/search?q=site%253A${tld}+${qs}`;window.location%20=%20gs;
# Your init script
#
# Atom will evaluate this file each time a new window is opened. It is run
# after packages are loaded/activated and after the previous editor state
# has been restored.
#
# An example hack to log to the console when each text editor is saved.
#
# atom.workspace.observeTextEditors (editor) ->
# editor.onDidSave ->
<!-- https://maxl.us/hideyt --><style>#playerWrap{display: inline-block; position: relative;}#playerWrap.shown::after{content:""; position: absolute; top: 0; left: 0; bottom: 0; right: 0; cursor: pointer; background-color: black; background-repeat: no-repeat; background-position: center; background-size: 64px 64px; background-image: url(data:image/svg+xml;utf8;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMjgiIGhlaWdodD0iMTI4IiB2aWV3Qm94PSIwIDAgNTEwIDUxMCI+PHBhdGggZD0iTTI1NSAxMDJWMEwxMjcuNSAxMjcuNSAyNTUgMjU1VjE1M2M4NC4xNSAwIDE1MyA2OC44NSAxNTMgMTUzcy02OC44NSAxNTMtMTUzIDE1My0xNTMtNjguODUtMTUzLTE1M0g1MWMwIDExMi4yIDkxLjggMjA0IDIwNCAyMDRzMjA0LTkxLjggMjA0LTIwNC05MS44LTIwNC0yMDQtMjA0eiIgZmlsbD0iI0ZGRiIvPjwvc3ZnPg==);}</style><div id="playerWrapOuter"> <div id="playerWrap"> <iframe width="640" height="360" src="https://www.youtube.com/embed/0sDg2h3M1RE?rel=0&enablejsapi=1" frameborder="0" ></iframe></div></div><script>(function(){let playerFrame=document.currentScript.previousElementSibling.q