Skip to content

Instantly share code, notes, and snippets.

View katylava's full-sized avatar
🐢

katy lavallee katylava

🐢
View GitHub Profile
@romkatv
romkatv / two-line-prompt.zsh
Last active September 20, 2024 13:26
Two-line ZSH prompt
# Example of two-line ZSH prompt with four components.
#
# top-left top-right
# bottom-left bottom-right
#
# Components can be customized by editing set-prompt function.
#
# Installation:
#
# (cd && curl -fsSLO https://gist.githubusercontent.com/romkatv/2a107ef9314f0d5f76563725b42f7cab/raw/two-line-prompt.zsh)
@jason-kane
jason-kane / kssh
Created June 27, 2016 18:17
Shell wrapper for exec-ing into a kubernetes container with friendly terminal settings
#!/bin/sh
if [ "$1" = "" ]; then
echo "Usage: kshell <pod>"
exit 1
fi
COLUMNS=`tput cols`
LINES=`tput lines`
TERM=xterm
kubectl exec -i -t $@ env COLUMNS=$COLUMNS LINES=$LINES TERM=$TERM bash
@ttscoff
ttscoff / dontforget.bash
Last active August 11, 2024 20:05
Quick reminders from Terminal (bash)
#!/bin/bash
# dontforget
#
# A stupid script for short term reminders in bash
#
# Arguments just need to contain a number and a bunch of words.
#
# The number can be anywhere in the arguments, but there shouldn't
# be any other numeric digits.
#
@ryanray
ryanray / aws-api-gateway-form-to-json.ftl
Created October 4, 2015 01:24
API Gateway application/www-form-urlencoded to application/json based on https://forums.aws.amazon.com/thread.jspa?messageID=673012&tstart=0#673012
## convert HTML POST data or HTTP GET query string to JSON
## get the raw post data from the AWS built-in variable and give it a nicer name
#if ($context.httpMethod == "POST")
#set($rawAPIData = $input.path('$'))
#elseif ($context.httpMethod == "GET")
#set($rawAPIData = $input.params().querystring)
#set($rawAPIData = $rawAPIData.toString())
#set($rawAPIDataLength = $rawAPIData.length() - 1)
#set($rawAPIData = $rawAPIData.substring(1, $rawAPIDataLength))
@peterbe
peterbe / indentations.py
Created July 7, 2015 16:41
Find what indentation a file uses
import re
from collections import defaultdict
start = re.compile('^\s+')
def avg(fn):
prev = None
diffs = []
for line in open(fn):
@nolanlawson
nolanlawson / protips.js
Last active August 22, 2024 14:19
Promise protips - stuff I wish I had known when I started with Promises
// Promise.all is good for executing many promises at once
Promise.all([
promise1,
promise2
]);
// Promise.resolve is good for wrapping synchronous code
Promise.resolve().then(function () {
if (somethingIsNotRight()) {
throw new Error("I will be rejected asynchronously!");
@katylava
katylava / 1-tasks.css
Last active April 17, 2017 20:04
HabitRPG Stylish styles
body {
/*
background: url(http://subtlepatterns.com/patterns/skulls.png);
background: url(http://subtlepatterns.com/patterns/halftone.png);
background: url(http://i.imgur.com/6Vkqf2z.png); /* wood panel *//*
*/
background: url(http://i.imgur.com/1bBINau.png); /* green cup */
}
@zombiecalypse
zombiecalypse / vim-html-markdown
Created June 24, 2014 22:12
Editing Google Docs locally as markdown with vim
#!/bin/sh
# Use as google docs edit --title "Reviews Regex Parse" --editor vim-html-markdown --format htm
file=$1
markdown=`tempfile --suffix=.mdown`
# Convert to markdown with pandocs
pandoc "$file" -f html -t markdown -o $markdown
# Edit the markdown file
{
"browser": false,
"node": true,
"predef": ["after", "afterEach", "before", "beforeEach", "describe", "it" ],
"strict": false, // this should unnecessary -- default is false -- but seems to be enabled in some environments
// Katy
// enforcing options
// "camelcase": true, // require camelCase or ALL_UPPER -- this would be nice but we don't control all identifiers (e.g. the ones from jsforce)
@walesmd
walesmd / IconServiceAgent.md
Last active June 4, 2024 19:48
A lot of people are having issues with com.apple.IconServicesAgent. Since this is a very new issue, Google was no help and `man iconservicesd` is even more hilarious. I eventually fixed it, when I was working on a completely different issue (that is still not fixed). The instructions are below and on the Apple Support Forum, https://discussions.…

I was chasing down another issue (slow "Save As") and thought these two issues may have been related (with QuickLook being the common broken link). Unfortunately, my "Save As" dialog is still miserably slow on the initial load; but IconServicesAgent hasn't gone above 30MB and he rarely makes an appearance in the Console!

Some of these steps may not be necessary, but here are all of the steps I took that inadverdently put IconServicesAgent back in its place. Note: all commands are a single-line, if they appear to be multiple that's just the forum formatting.

  1. Check for any QuickLooks related .plist files. In a terminal: mdfind com.apple.quicklook. -name .plist

  2. I only had files at the system level (specifically within /System/Library/LaunchAgents/). If you have others, modify the directions below to take that into account (re-introducing plist files from the system level back up to the user).

  3. Make some temporary directories to store these plist files, just in case: mkdir ~/tmp-quicklook