Skip to content

Instantly share code, notes, and snippets.

Being awesome 😎

Jake 'Sid' Smith JakeSidSmith

Being awesome 😎
View GitHub Profile
JakeSidSmith /
Last active Mar 4, 2021
TypeScript: inference of named arguments differs from positional arguments

TypeScript version: 4.2.2


  "compilerOptions": {
    "strict": true,
    "noUnusedLocals": true,
    "noUnusedParameters": true,
    "noUncheckedIndexedAccess": true,
JakeSidSmith / launch-chromium
Last active Jan 9, 2020
Openbox config to launch a full screen Chromium on Raspberry Pi running Raspbian Lite
View launch-chromium
# Disable any form of screen saver / screen blanking / power management
xset s off
xset s noblank
xset -dpms
# Allow quitting the X server with CTRL-ATL-Backspace
setxkbmap -option terminate:ctrl_alt_bksp
# Start Chromium in kiosk mode
sed -i 's/"exited_cleanly":false/"exited_cleanly":true/' ~/.config/chromium/'Local State'
JakeSidSmith / with-click-outside.ts
Created Apr 24, 2019
React higher order component to add "click outside" events to elements
View with-click-outside.ts
import React, { MouseEvent, PureComponent } from 'react';
interface Props {
onClickOutside: () => any;
// @TODO: element should be constrained to 'keyof ReactHTML' but this causes some crazy memory leak
export const withClickOutside = (element: string) => {
const Element = element;
JakeSidSmith / poller.ts
Created Dec 20, 2018
Class to ease process of polling an endpoint
View poller.ts
import axios, { AxiosRequestConfig, AxiosError, AxiosResponse, CancelTokenSource } from 'axios';
interface PollOptions<PollResponse, CompleteResponse> {
interval: number;
shouldContinuePolling: (response: PollResponse | CompleteResponse) => response is PollResponse;
isComplete: (response: PollResponse | CompleteResponse) => response is CompleteResponse;
onStart?: () => any;
onStop?: () => any;
onError: (error: AxiosError) => any;
onComplete: (response: CompleteResponse) => any;
JakeSidSmith / usage.tsx
Last active Oct 12, 2018
wrapThunkAction - correctly types thunk actions as if they had been mapped with dispatch
View usage.tsx
import React, { Component } from 'react';
import { connect } from 'react-redux';
import { wrapThunkAction } from './somewhere';
import { action } from './actions';
const wrappedAction = wrapThunkAction(action);
interface DispatchProps {
action: typeof wrappedAction;
JakeSidSmith /
Last active Jul 13, 2018
Find bad version of eslint-scope in global node_modules, nvm dir, trash, and current directory.

Running this script locally

  1. cd into your "projects" directory, or whatever folder all of your projects are stored in.

  2. Run the following:

curl -s | bash
JakeSidSmith / .bash_node
Created Jun 22, 2018
Bash profile extension to automatically change NodeJS versions with NVM
View .bash_node
#! /usr/bin/env bash
function check_node_version () {
JakeSidSmith /
Last active Apr 2, 2018
Async's Spring 2018 Show n' Tell

[Async's][async] [2018 Spring Show n' Tell][event]

Thursday 5th April, 2018

  • [Full info on the Async website][event]

Speakers gist

Would you like to speak on the night? You'll have five minutes to tell us about something: a project, a library, a technique, a story, or anything else about JavaScript, HTML, CSS, or the wider world of tech.

JakeSidSmith /
Last active Mar 29, 2018
List of Brighton & Hove Design, Development, and Various Other Tech / Nerdy Meetups

ANNOUNCEMENT: We've moved all of these meetups to a better maintained website called Brighton Brains - add it to your bookmarks, share it on your social media, etc. :D

Brighton & Hove Design, Development, and Related Meetups



A JavaScript meetup for Brighton & Hove