Skip to content

Instantly share code, notes, and snippets.

Avatar
🍋
when life gives you lemons, make hummus

Michael Floering hangtwenty

🍋
when life gives you lemons, make hummus
View GitHub Profile
@hangtwenty
hangtwenty / How to make VS Code focus the Debug sidebar instead of Explorer.md
Last active Mar 26, 2021
How to make VS Code focus the Debug sidebar instead of File Explorer
View How to make VS Code focus the Debug sidebar instead of Explorer.md

It took me a little bit to find this setting so I'm writing it down for friends.

After you finish a debug session in VS Code, it may change the sidebar's focus back to the File Explorer.

I don't think it is the default setting, but mine was set that way (and I didn't remember that).

To change it in your settings JSON:

@hangtwenty
hangtwenty / Alfred Workflows — where to find (or add) a script.md
Last active Mar 8, 2021
Where to find helper script files, etc, for Alfred Workflows. (alfredapp.com)
View Alfred Workflows — where to find (or add) a script.md

ℹ️ There's also an Alfred Workflow for searching and grabbing this directory.

  • Manage Alfred Extension - List and view details about installed Alfred extensions. Additional features added: Open in iTerm, Copy Path and Browse Data Directory.

Directory with all Alfred Workflows:

cd /Applications/AlfredSync/Alfred.alfredpreferences/workflows
@hangtwenty
hangtwenty / Uniform Type Identifiers (UTI).md
Last active Mar 8, 2021
I always forget where to find this, so here's a copy. It's an old-but-still-useful thing from the Apple Developer documentation archive, and it's from 2005 (whoa, right?)
View Uniform Type Identifiers (UTI).md

What's a Uniform Type Identifier?

Each UTI provides a unique identifier for a particular file type, data type, directory or bundle type, and so on. In addition, other type identifier namespaces for a particular type can be grouped under one UTI, with utility functions available to translate from one format to another.

What's the table below?

The following tables list uniform type identifiers (UTIs) that are declared by the system as of OS X v10.4. [Which was released in 2005. That means it's NOT up to date. Apple Developer stuff has the up to date docs. Still, these can be useful for scripting, Alfred Workflows, and so on.]

Note: T

@hangtwenty
hangtwenty / RubyMine - project SDK problem (using asdf).md
Last active Mar 8, 2021
How to fix Rubymine having issues finding your Ruby SDK. I hit this when switching from rbenv to asdf.
View RubyMine - project SDK problem (using asdf).md

problem:

Error configuring SDK: [...]. 
Please make sure that [... ruby path, from asdf or otherwise ...] is a valid home path for this SDK type.

solution that worked for me:

  1. close RubyMine
@hangtwenty
hangtwenty / master.vim
Last active Feb 9, 2021 — forked from gmccreight/master.vim
Shortened fork of master.vim, which is "a script that gives you a playground for mastering vim." I learned via vim-adventures.com originally (highly recommend!) but this was good too. I removed sections I don't use, because I use vim keybindings inside other editors (and prefer the editors' functionality for anything "fancy")
View master.vim
" copy all this into a vim buffer, save it, then...
" source the file by typing :so %
" Now the vim buffer acts like a specialized application for mastering vim
" There are two queues, Study and Known. Depending how confident you feel
" about the item you are currently learning, you can move it down several
" positions, all the way to the end of the Study queue, or to the Known
" queue.
" type ,, (that's comma comma)
@hangtwenty
hangtwenty / absolute_path_to_script_directory.sh
Created Dec 7, 2020
bash/zsh script - how to get absolute path to itself
View absolute_path_to_script_directory.sh
export HERE="$( cd "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )"
# example usage - source a script in same directory. but using absolute path,
# ... which you'd do so that a script can be called from wherever. (not dependent on working directory ($PWD))
. "${HERE}/common.sh"
# ... or of course you could export DIRNAME or whatever you want.
# In scripts I just find "$HERE/node_modules", "$HERE/src" etc to be pretty readable.
View aligning-images.md

Aligning images

left alignment

This is the code you need to align images to the left:

<img align="left" width="100" height="100" src="http://www.fillmurray.com/100/100">
@hangtwenty
hangtwenty / stash_dropped.md
Last active Oct 9, 2019 — forked from joseluisq/stash_dropped.md
How to recover a dropped stash in Git?
View stash_dropped.md

How to recover a dropped stash in Git?

1. Find the stash commits:

git log --graph --oneline --decorate $( git fsck --no-reflog | awk '/dangling commit/ {print $3}' )

This will show you all the commits at the tips of your commit graph which are no longer referenced from any branch or tag – every lost commit, including every stash commit you’ve ever created, will be somewhere in that graph.

@hangtwenty
hangtwenty / python_test_impact_analysis.md
Last active Mar 28, 2019
Note on Python TIA (Test Impact Analysis)
View python_test_impact_analysis.md

Question:

What could I try for doing Test Impact Analysis for Python projects?

Answer:

There are a few libraries out there you could try. Here are some entrypoints: