Skip to content

Instantly share code, notes, and snippets.

View jaketrent's full-sized avatar
🎹
Coding a power ballad

Jake Trent jaketrent

🎹
Coding a power ballad
View GitHub Profile
@jaketrent
jaketrent / dynamicContent.test.js
Created June 9, 2021 20:18
Jest test dynamic React children
describe('dynamic content', () => {
beforeAll(() => {
jest.useFakeTimers()
})
afterAll(() => {
jest.useRealTimers()
})
it('allows tabbing to dynamic child', async () => {
const DynamicChildren = () => {
const [showButton, setShowButton] = React.useState(false)
@jaketrent
jaketrent / README.md
Last active May 17, 2021 16:06
Reproducing glamor warning in build error

Confirmed! I am able to reproduce the warning when running npm run build:

export 'default' (imported as 'glamorDefault') was not found in 'glamor' (possible exports ...)

This is unfortunate because it is chatty in your build logs. It should not cause a problem at runtime, however.

The short-term guidance for this warning is to try to ignore it for the next couple months. This is because glamor is being removed from the Design System over the next couple months.

@jaketrent
jaketrent / hideLikes.js
Created April 28, 2020 22:18
Userscript for Tampermonkey et al that hides twitter post like counts
// ==UserScript==
// @name Hide My Twitter Like Counts
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Hide the like count
// @author jaketrent
// @include https://twitter.com/*
// @include http://twitter.com/*
// @grant none
// ==/UserScript==
@jaketrent
jaketrent / jakeConf.md
Created July 29, 2019 17:15
JakeConf - July 2019
@jaketrent
jaketrent / spacemacs.md
Created June 19, 2018 12:28
Flow on Spacemacs

Some quick notes:

  • install nvm
  • install node - with nvm
  • install bash - setup node/npm in bash (just zsh won't work)
  • install tern - clone; npm install - drives autocomplete
  • install flow-bin in proj - uses local flow
  • install spacemacs flow thing - https://github.com/tbinetruy/config - ties autocomplete into flow

For https://gowiththeflowtype.com/

@jaketrent
jaketrent / main.js
Created February 23, 2018 14:10
Simple electron main.js
const electron = require('electron')
const app = electron.app
const BrowserWindow = electron.BrowserWindow
let mainWindow
app.on('ready', _ => {
mainWindow = new BrowserWindow({
height: 400,
@jaketrent
jaketrent / client-usage.js
Created August 7, 2017 19:14
glamorous glamor.css as className
<P className={glamor.css({ color: 'blue' })}>wow</P>
@jaketrent
jaketrent / Main.elm
Created March 20, 2017 13:47
A headless Elm program
module Main exposing (..)
import MyProgram exposing (print)
import Platform exposing (program)
nodeProgram : a -> Program Never () ()
nodeProgram _ =
program
{ init = ( (), Cmd.none )
@jaketrent
jaketrent / parseDbCopyToMarkdown.js
Created February 19, 2017 14:41
Convert database copy data to markdown
const fs = require('fs')
// input format:
// 25 The Innovator’s Dilemma The simultaneous need and danger to reinvent oneself and one's business is the dilemma. Do we disrupt ourselves or do we double-down on core competencies? A dilemma indeed! http://i.imgur.com/exW4j8F.jpg 2014-08-20 2014-11-28 19:05:28.153598 2014-11-28 19:05:28.153598 Craig Christensen http://www.amazon.com/gp/product/B00E257S86/ref=as_li_tl?ie=UTF8&camp=1789&creative=390957&creativeASIN=B00E257S86&linkCode=as2&tag=jaktre-20&linkId=5CDH2BHJK7TZT52R
const separateColumns = line => line.split('\t')
const nameColumns = line => ({
id: line[0],
title: line[1],
description: line[2],
coverUrl: line[3],
.container {
display: flex;
height: 75px;
line-height: 75px;
justify-content: flex-start;
margin-bottom: 30px;
}
.container > div {
overflow: hidden;
white-space: nowrap;