Skip to content

Instantly share code, notes, and snippets.

Avatar
🎹
Coding a power ballad

Jake Trent jaketrent

🎹
Coding a power ballad
View GitHub Profile
@jaketrent
jaketrent / dynamicContent.test.js
Created Jun 9, 2021
Jest test dynamic React children
View dynamicContent.test.js
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
Reproducing glamor warning in build error
View README.md

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 Apr 28, 2020
Userscript for Tampermonkey et al that hides twitter post like counts
View hideLikes.js
// ==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 Jul 29, 2019
JakeConf - July 2019
View jakeConf.md
@jaketrent
jaketrent / spacemacs.md
Created Jun 19, 2018
Flow on Spacemacs
View spacemacs.md

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 Feb 23, 2018
Simple electron main.js
View 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 Aug 7, 2017
glamorous glamor.css as className
View client-usage.js
<P className={glamor.css({ color: 'blue' })}>wow</P>
@jaketrent
jaketrent / Main.elm
Created Mar 20, 2017
A headless Elm program
View Main.elm
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 Feb 19, 2017
Convert database copy data to markdown
View parseDbCopyToMarkdown.js
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],
View flexTitleExperiment.css
.container {
display: flex;
height: 75px;
line-height: 75px;
justify-content: flex-start;
margin-bottom: 30px;
}
.container > div {
overflow: hidden;
white-space: nowrap;