Skip to content

Instantly share code, notes, and snippets.

@ross-f
ross-f / dark-code.js
Created January 28, 2022 13:08
VsCode switch theme with command
#!/usr/bin/env node
// put this file somewhere in you $PATH
// then use some other external software to run this command on a key combo
var path = "${HOME}/.config/Code - OSS/User/settings.json";
var settings = require(path);
// change these to your preference
const themes = {
@ross-f
ross-f / .zshrc-no-no-verify-snippet
Last active January 28, 2022 13:37
Confirm a git commit --no-verify
# put this at the end of your zshrc
function git {
if [[ "$1" == "commit" && "$@" == *"--no-verify"* ]]; then
cat << EOF
WHOA! What do you think your doing?!
You can't be running --no-verify that could seriously break some stuff.
You should probably press Ctrl+C to stop what you're doing right now. But if you really want to continue you can just press enter but also please don't do that.
EOF
head -1
@ross-f
ross-f / amplify-shell-theme-snippet.sh
Last active January 28, 2022 12:38
Amplify Env in shell
# add this to your shell theme, e.g: ~/.oh-my-zsh/themes/clean.zsh-theme
# stolen from https://www.xiegerts.com/post/show-current-aws-amplify-environment/
# call this like $(amplify_env)
amplify_env () {
# check current
if [[ -d './amplify' ]]; then
ampdir='.'
fi
#!/bin/bash
server=""
user=""
pass=""
loginScript="quote USER $user
quote PASS $pass"
function send {
filelocal=$1
@ross-f
ross-f / recursion.js
Last active July 10, 2018 21:55
Recursion example
var sum = 0;
var tree = {
value: 1,
left: {
value: 5,
left: {
value: 36
},
right: {
@ross-f
ross-f / tmux.conf
Created May 7, 2016 14:23 — forked from anonymous/tmux.conf
vim friendly tmux configuration
#Prefix is Ctrl-a
set -g prefix C-a
bind C-a send-prefix
unbind C-b
set -sg escape-time 1
set -g base-index 1
setw -g pane-base-index 1
#Mouse works as expected