Skip to content

Instantly share code, notes, and snippets.

View thatkookooguy's full-sized avatar

Neil Kalman thatkookooguy

View GitHub Profile

Lesson: Benefits of Small Commits (with unit-tests included)

Introduction

In this lesson, we'll explore the benefits of working with small commits and maintaining functional code at every step. We'll use a simple TypeScript calculator project and add basic operations one by one, pairing each change with its corresponding unit test using Jest. After completing the initial development, we'll introduce git bisect to demonstrate how small commits make debugging easier.

The calculator project should reflect the same stack we're using: Typescript, and jest.

some good examples of gpt chat

@thatkookooguy
thatkookooguy / chrome-extensions.md
Last active December 14, 2021 17:10
Recommended Chrome Extensions for Developers

Chrome Extension Recommendations

. Name Description
image wappalyzer Identify web technologies
Wappalyzer is a technology profiler that shows you what websites are built with.
Find out what CMS a website is using, as well as any framework, ecommerce platform, JavaScript libraries and many more.

Wappalyzer is more than a CMS detector or framework detector: it uncovers more than a thousand technologies in dozens of categories such as programming languages, analytics, marketing tools, payment processors, CRM, CDN and others.

Install Wappalyzer for Chrome to find out the technologies used on websites you visit at glance.
![image](https://user-images.githubusercontent.com/10427304/146043851-dbcfdef3-f1fb-4da8-82f0
{
"npmName": "@kibibit/sample-webapi",
"ngVersion":"6.0.0",
"withInterfaces": true,
"supportsES6": true
}
export class inactivityCheck {
private timeoutId: ReturnType<typeof setTimeout>;
constructor(
public element: HTMLElement,
public delay: number,
public callbackActive: (element: HTMLElement) => void,
public callbackInactive: (element: HTMLElement) => void
) {
this.setupTimers();
}

In order to deploy things and use docker from INSIDE wsl2

on windows, run the following command:

docker run -d --name unix-connect --restart=always -p 127.0.0.1:23750:2375 -v /var/run/docker.sock:/var/run/docker.sock  alpine/socat  tcp-listen:2375,fork,reuseaddr unix-connect:/var/run/docker.sock

Then, add this line at the end of your .zshrc or .bashrc file:

export DOCKER_HOST=tcp://127.0.0.1:23750
@thatkookooguy
thatkookooguy / chart-colors.js
Created November 15, 2020 22:41 — forked from thomasloven/chart-colors.js
Replace history graph colors in lovelace
// Add this to your lovelace resources as
// url: /local/chart-colors.js
// type: module
customElements.whenDefined('ha-chart-base').then(() => {
// Find the HaChartBase class
const HaChartBase = customElements.get('ha-chart-base');
// Write a new color list generator
@thatkookooguy
thatkookooguy / import-to.js
Created September 29, 2020 12:04
example of require
const lib = require('./node-module');
const newPizza = new lib.Pizza();
// or
const { Pizza, Lazagna, constant } = require('./node-module');
const newPizza = new Pizza();

I did something similar for myself. It should work the same for a group of steam friends if the data is the same (which I guess it is if you're using a steam sensor for each one of them).

I'll just say up-front that this is a lot of setup to get this to happen. But it shouldn't! I plan to make this into a custom HACS card since just getting all this data directly from the steam sensor will be much easier with a custom card. I'll keep you posted when that happens, but I hope this will get you what you want in the meanwhile :slight_smile:

My setup shows the following things (see image for reference):

  • my steam entity without a now playing section when I'm not playing a game
  • a "now playing" section once I start playing a game
  • an hassio notification when I start playing a game

Here's how I set it up:

@thatkookooguy
thatkookooguy / thatkookooguy_osx_bootstrap.sh
Last active June 6, 2021 08:16
thatkookooguy osx bootstrap
#!/usr/bin/env bash
#
# Bootstrap script for setting up a new OSX machine
#
# This should be idempotent so it can be run multiple times.
#
# Some apps don't have a cask and so still need to be installed by hand. These
# include:
#
# - Twitter (app store)