Skip to content

Instantly share code, notes, and snippets.

View thatkookooguy's full-sized avatar

Neil Kalman thatkookooguy

View GitHub Profile
@thatkookooguy
thatkookooguy / sleep-sort.js
Last active May 5, 2024 09:48 — forked from vstarck/sleep_sort.js
Sleep Sort in JavaScript | http://t.co/nWJACyK
// from: http://dis.4chan.org/read/prog/1295544154/170
function sleepSort(list, callback) {
const result = [];
list.forEach((i) => setTimeout(() => {
result.push(i);
if (result.length == list.length) {
callback(result);
}

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
@thatkookooguy
thatkookooguy / nk-mixin.scss
Last active July 21, 2021 11:11
scss mixin
$tablet-width: 768px;
$desktop-width: 1024px;
@mixin nk-phone {
@media (max-width: #{$tablet-width - 1px}) {
@content;
}
}
/* makes nested animations without naming very easy.
{
"npmName": "@kibibit/sample-webapi",
"ngVersion":"6.0.0",
"withInterfaces": true,
"supportsES6": true
}
@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)
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

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 / 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