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
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 / 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: {
@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
// 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",
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<script id="jsbin-javascript">
[4/5] ⠁ sharp
error /Users/ivan/dev/gatsby-starter-reasonml-2/node_modules/sharp: Command failed.
Exit code: 1
Command: (node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy)
Arguments:
Directory: /Users/ivan/dev/gatsby-starter-reasonml-2/node_modules/sharp
Output:
info sharp Downloading https://github.com/lovell/sharp-libvips/releases/download/v8.7.0/libvips-8.7.0-darwin-x64.tar.gz
prebuild-install WARN install No prebuilt binaries found (target=12.13.1 runtime=node arch=x64 libc= platform=darwin)
gyp info it worked if it ends with ok
@ivanoats
ivanoats / keybindings.json
Created October 19, 2018 20:42
Visual Studio Code Keyboard Shortcuts customization
// Place your key bindings in this file to overwrite the defaults
[
{
"key": "f1",
"command": "extension.dash.specific",
"when": "editorTextFocus"
},
{
"key": "alt+cmd+r",
"command": "workbench.action.tasks.runTask",
@ivanoats
ivanoats / .eslintrc.js
Created September 24, 2018 16:18 — forked from nkbt/.eslintrc.js
Strict ESLint config for React, ES6 (based on Airbnb Code style)
{
"env": {
"browser": true,
"node": true,
"es6": true
},
"plugins": ["react"],
"ecmaFeatures": {