Skip to content

Instantly share code, notes, and snippets.

View ivanoats's full-sized avatar
💭
🤙 Stoked 🏄‍♂️

Ivan Storck ivanoats

💭
🤙 Stoked 🏄‍♂️
View GitHub Profile
@ivanoats
ivanoats / .zshrc
Created February 27, 2024 21:46 — forked from callumlocke/.zshrc
ZSH function to auto-switch to correct Node version
####
# ZSH function to auto-switch to correct Node version
# https://gist.github.com/callumlocke/30990e247e52ab6ac1aa98e5f0e5bbf5
#
# - Searches up your directory tree for the closest .nvmrc, just like `nvm use` does.
#
# - If you are already on the right Node version, IT DOES NOTHING, AND PRINTS NOTHING.
#
# - Works correctly if your .nvmrc file contains something relaxed/generic,
# like "4" or "v12.0" or "stable".
@ivanoats
ivanoats / http-command.sh
Last active December 21, 2023 05:30
command to get elks weather data
#!/usr/bin/env bash
http --body https://swd.weatherflow.com/swd/rest/locations/126636\?api_key\=a8f5dbda-af0a-4b57-99b9-f10baa88f27b\&build\=83\&include_arbitrary_locations\=true\&_\=1703136139243
@ivanoats
ivanoats / gist:1823034
Last active November 19, 2022 06:08 — forked from parndt/gist:958385
Setting up GIT Bash autocompletion. Use this only if you are using Bash instead of ZSH.
<html>
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
<h1>Message Decoder</h1>
<button id="decrypt">Decrypt!</button>
@ivanoats
ivanoats / csv.test.ts
Created December 1, 2021 19:46
Error with Jest and CSV-Parse lib
#tests/pages/api/csv.test.ts
import { createMocks } from 'node-mocks-http';
import handler from '../../../src/pages/api/csv';
describe('/api/csv', () => {
test('returns Observations object', async () => {
const { req, res } = createMocks({
method: 'GET',
query: {
import type { Config } from '@jest/types';
import nextJest from 'next/jest';
const createJestConfig = nextJest({
// Provide the path to your Next.js app to load next.config.js and .env files in your test environment
dir: './',
});
// Add any custom config to be passed to Jest
const customJestConfig: Config.InitialOptions = {
@ivanoats
ivanoats / sublime-draft.md
Last active December 28, 2021 07:10
sublime draft

Link Bash to Sublime

On the Mac - run this command in Terminal

Sublime Text 2:

ln -s /Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl /usr/local/bin/subl

Sublime Text 3:

@ivanoats
ivanoats / geolocation.js
Created October 20, 2021 04:40 — forked from videlais/geolocation.js
Complete Geolocation.js
/*
* A Geolocation object
*
* Note: Uses GPS or similar hardware for data if available through
* the browser, but will fall back to using (Google) geolocation
* services with current IP address automatically.
*
* @property {boolean} supported If the geolocation functions are available in the current context
* @property {function} onsuccess The function to be called if the geolocation services are successful
* @property {function} onerror The function to be called if an error occurs
@ivanoats
ivanoats / slang.md
Last active February 23, 2021 00:58
slang for various symbols
!  = bang
.  = dot
$  = bling
{} = mustaches
[] = brackets
() = parens
^  = caret
&  = and
*  = asterik
// This file was initially generated by Windows Terminal 1.2.2381.0
// It should still be usable in newer versions, but newer versions might have additional
// settings, help text, or changes that you will not see unless you clear this file
// and let us generate a new one for you.
// To view the default settings, hold "alt" while clicking on the "Settings" button.
// For documentation on these settings, see: https://aka.ms/terminal-documentation
{
"$schema": "https://aka.ms/terminal-profiles-schema",