Skip to content

Instantly share code, notes, and snippets.

View jblyberg's full-sized avatar
🏠
Working from home

John Blyberg jblyberg

🏠
Working from home
View GitHub Profile
@jblyberg
jblyberg / fish_install.md
Last active July 20, 2024 17:58 — forked from gagarine/fish_install.md
Install fish shell on macOS Mojave with brew

Installing Fish shell on MacOS (Intel and M1) using brew

Fish is a smart and user-friendly command line (like bash or zsh). This is how you can instal Fish on MacOS and make your default shell.

Note that you need the https://brew.sh/ package manager installed on your machine.

Install Fish

brew install fish

@jblyberg
jblyberg / kubedf.sh
Last active January 5, 2024 17:14
Script to get freespace in persistent volumes
#!/usr/bin/env bash
# Make sure to `brew install jq coreutils`
NODESAPI=/api/v1/nodes
function getNodes() {
kubectl get --raw $NODESAPI | jq -r '.items[].metadata.name'
}
@jblyberg
jblyberg / tailwind-color-variables.css
Created August 26, 2023 18:23
Tailwind colors as CSS variables
:root {
--slate-50: #f8fafc;
--slate-100: #f1f5f9;
--slate-200: #e2e8f0;
--slate-300: #cbd5e1;
--slate-400: #94a3b8;
--slate-500: #64748b;
--slate-600: #475569;
--slate-700: #334155;
@jblyberg
jblyberg / custom.itermcolors
Created January 16, 2022 20:07
iTerm Color Definitions
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Ansi 0 Color</key>
<dict>
<key>Alpha Component</key>
<real>1</real>
<key>Blue Component</key>
<real>0.4784277081489563</real>
@jblyberg
jblyberg / .esintrc.js
Last active December 8, 2021 16:07
Typescript linting example
module.exports = {
parser: '@typescript-eslint/parser',
parserOptions: {
project: 'tsconfig.json',
sourceType: 'module',
},
plugins: ['@typescript-eslint/eslint-plugin'],
extends: [
'plugin:@typescript-eslint/recommended',
'plugin:unicorn/recommended',
@jblyberg
jblyberg / module-development-workflow.md
Created February 2, 2021 13:26 — forked from alanbsmith/module-development-workflow.md
A suggested module development workflow

Module Development Workflow

Overview

This is a suggested workflow for building npm modules locally. The particular context will be focused on building a React component lib, but the workflow can be applied for any npm module.

Linking

yarn link is a really great tool for local development. It builds a global npm module that is symlinked to your local repo. So when you make a change to the repo, the global module is automatically updated.

@jblyberg
jblyberg / FormState.js
Last active January 17, 2020 19:56
Form state tracker for use with Vue components using Vue composition API (or Vue 3)
import { computed } from '@vue/composition-api';
import { isEqual } from 'lodash';
export default class FormState {
constructor() {
this.initialFormVals = {};
this.formVals = {};
this.loading = true;
this.submitted = false;
#!/usr/bin/env bash
# ~/.macos — https://mths.be/macos
# Close any open System Preferences panes, to prevent them from overriding
# settings we’re about to change
osascript -e 'tell application "System Preferences" to quit'
# Ask for the administrator password upfront
sudo -v
@jblyberg
jblyberg / disable.sh
Last active December 2, 2019 22:33
Disable bunch of #$!@ in Catalina
#!/bin/bash
# IMPORTANT: Don't forget to logout from your Apple ID in the settings before running it!
# IMPORTANT: You will need to run this script from Recovery. In fact, macOS Catalina brings read-only filesystem which prevent this script from working from the main OS.
# This script needs to be run from the volume you wish to use.
# E.g. run it like this: cd /Volumes/Macintosh\ HD && sh /Volumes/Macintosh\ HD/Users/sabri/Desktop/disable.sh
# WARNING: It might disable things that you may not like. Please double check the services in the TODISABLE vars.
# Get active services: launchctl list | grep -v "\-\t0"
# Find a service: grep -lR [service] /System/Library/Launch* /Library/Launch* ~/Library/LaunchAgents
@jblyberg
jblyberg / syncLocalSettings.json
Last active November 18, 2019 14:54
VSCode sync settings global config. Goes in ~/Library/Application Support/Code/User
{
"ignoreUploadFiles": [
"state.*",
"syncLocalSettings.json",
".DS_Store",
"sync.lock",
"projects.json",
"projects_cache_vscode.json",
"projects_cache_git.json",
"projects_cache_svn.json",