Skip to content

Instantly share code, notes, and snippets.

View floer32's full-sized avatar

Michael Floering floer32

  • 21:22 (UTC -07:00)
View GitHub Profile
@floer32
floer32 / git ribbon, git catchup.md
Last active May 25, 2022 17:41
git ribbon, git catchup

How I keep up with changes on main

[1/2] These two git aliases: git ribbon, git catchup

I've used these for years (found here)

  • git ribbon to mark latest main you've reviewed (like a ribbon in a journal)
  • git catchup to review diff since then. (then do git ribbon again after reviewing, so it's ready for tomorrow.)

In your ~/.gitconfig, [aliases] section:

@floer32
floer32 / auto-open-devtools-for-tabs.md
Last active December 3, 2021 06:54
memo - how to open chrome with the javascript console open by default, on a mac
/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --auto-open-devtools-for-tabs

Canary:

/Applications/Google\ Chrome\ Canary.app/Contents/MacOS/Google\ Chrome\ Canary --auto-open-devtools-for-tabs
@floer32
floer32 / How to make VS Code focus the Debug sidebar instead of Explorer.md
Last active March 26, 2021 01:01
How to make VS Code focus the Debug sidebar instead of File Explorer

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:

@floer32
floer32 / Alfred Workflows — where to find (or add) a script.md
Last active March 8, 2021 19:02
Where to find helper script files, etc, for Alfred Workflows. (alfredapp.com)

ℹ️ 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
@floer32
floer32 / Uniform Type Identifiers (UTI).md
Last active August 5, 2022 18:06
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?)

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

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

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
@floer32
floer32 / master.vim
Last active February 9, 2021 17:45 — 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")
" 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)
@floer32
floer32 / absolute_path_to_script_directory.sh
Created December 7, 2020 23:24
bash/zsh script - how to get absolute path to itself
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.
When life gives you lemons, make hummus

Aligning images

left alignment

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