Skip to content

Instantly share code, notes, and snippets.

View joshmfrankel's full-sized avatar
🇺🇦

Josh Frankel joshmfrankel

🇺🇦
View GitHub Profile
@joshmfrankel
joshmfrankel / Default (OSX).sublime-keymap
Last active November 3, 2023 16:57
New Computer Setup
[
{ "keys": ["super+shift+k"], "command": "run_macro_file", "args": {"file": "res://Packages/Default/Delete Line.sublime-macro"} },
{
"keys": ["alt+shift+1"],
"command": "set_layout",
"args":
{
"cols": [0.0, 1.0],
"rows": [0.0, 1.0],
"cells": [[0, 0, 1, 1]]
@joshmfrankel
joshmfrankel / gist:6ef9881581b7f3fb41f845803d63f1bf
Last active February 23, 2022 01:22
Ruby: Singelton example of wrapping child method from Parent
module BaseService
extend ActiveSupport::Concern
class_methods do
def call(*args, **keyword_args)
service = new
def service.result=(result)
@result = result
end
@joshmfrankel
joshmfrankel / bash-functions.txt
Last active January 29, 2022 14:56
Sublime Text: Preferences
########################
# User-defined Methods #
########################
# Kill Process by
#
# port - All processes with port will be killed
# name - All processes given a name will be killed
function kill-process-by()
{
case $1 in
@joshmfrankel
joshmfrankel / setup.sh
Last active March 9, 2023 14:05
Linux: Setup development environment script
#!/bin/bash
echo "#### PREPPING DEPENDENCIES"
sudo apt install -y apt-transport-https curl software-properties-common
flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
echo "#### ADDING GPG KEYS"
sudo curl -fsSLo /usr/share/keyrings/brave-browser-archive-keyring.gpg https://brave-browser-apt-release.s3.brave.com/brave-browser-archive-keyring.gpg
wget -qO - https://download.sublimetext.com/sublimehq-pub.gpg | sudo apt-key add -
curl -sS https://download.spotify.com/debian/pubkey_5E3C45D7B312C643.gpg | sudo apt-key add -
curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg
@joshmfrankel
joshmfrankel / rspec-notify-hook.rb
Created January 11, 2022 20:37
RSpec: Notify hook
config.after(:suite) do
reporter = config.reporter
total_examples = reporter.examples.count
failed_examples = reporter.failed_examples.count
if failed_examples == 0
fork { exec("osascript -e 'display notification \"#{total_examples} test(s) passed\" with title \"\u2705 RSpec Passed\"'") }
else
fork { exec("osascript -e 'display notification \"#{failed_examples} failed, #{total_examples - failed_examples} passed\" with title \"\u26D4 RSpec Failed\"'") }
end
end
@joshmfrankel
joshmfrankel / keyboard.md
Last active June 15, 2021 18:55
My Keyboard Shortcuts

System

Action Shortcut
Spotlight Search super + space
Application Window super + up
Mission Control super + down
Clippy History alt + v
Workspace navigate right super + right
Workspace navigate left super + left
Workspace show active windows super + down
@joshmfrankel
joshmfrankel / Default (OSX).sublime-keymap
Last active April 2, 2020 19:43
Mac OSX Config - Karabiner Elements, iterm2, Sublime Text
[
{ "keys": ["ctrl+p"], "command": "show_overlay", "args": {"overlay": "goto", "show_files": true} },
{ "keys": ["ctrl+shift+p"], "command": "show_overlay", "args": {"overlay": "command_palette"} },
{ "keys": ["ctrl+d"], "command": "find_under_expand" },
{ "keys": ["option+shift+up"], "command": "swap_line_up" },
{ "keys": ["option+shift+down"], "command": "swap_line_down" },
{ "keys": ["ctrl+shift+up"], "command": "swap_line_up" },
{ "keys": ["ctrl+shift+down"], "command": "swap_line_down" },
{ "keys": ["ctrl+shift+super+d"], "command": "clone_file" },
{ "keys": ["home"], "command": "move_to", "args": {"to": "bol"} },
@joshmfrankel
joshmfrankel / shortcuts.txt
Created January 15, 2020 11:10
Keyboard Shortcuts
ctrl + left/right - Previous/Next Word
fn + up/down - Page Up/Down
cmd + left/right - Previous/Next Workspace
ctrl + cmd + left/right - Move current window to 50% left/right side of page
cmd + alt + left/right - Move current window to Prev/Next Workspace
cmd + up - Fullscreen current window
cmd + down - See all windows
# Chrome, Sublime, Terminal
ctrl + t - New Tab
@joshmfrankel
joshmfrankel / apps.txt
Last active February 10, 2021 14:55
Upgrading to new linux
bookworm
compizConfig (maybe not needed)
dconf Editor
diodon - copy/paste clipboard
eddy - simple pkg installer
elementary+ configurator
Emojione picker
FeedReader
Franz
Gifup (maybe not needed)
@joshmfrankel
joshmfrankel / template_error.rb
Created July 11, 2017 15:04
Ruby: Template Pattern
raise NotImplementedError, "This #{self.class} cannot respond to:"