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 / fixBrokenHTMLString.php
Last active September 8, 2023 12:22
PHP: Fix broken html tags in string and use html entities
/**
* Fix for broken html tags inside strings for php.
*
* By using passing the html through DOMDocument and converting the html
* entities we are left with beautiful well formatted code. Huzzah!
*
* "Nothing is ever easy" -Zedd, Wizards First Rule
*
* @var DOMDocument
*/
@joshmfrankel
joshmfrankel / .zshrc
Last active August 20, 2023 23:04
Oh-my-zsh + powerlevel9k + powerline fonts + awesome-terminal-fonts + syntax highlighting
# References
# OhMyZsh: https://github.com/robbyrussell/oh-my-zsh
# Powerlevel9k: https://github.com/bhilburn/powerlevel9k
# Powerline fonts: https://github.com/powerline/fonts
# Awesome Terminal Fonts: https://github.com/gabrielelana/awesome-terminal-fonts
# ZSH Syntax Highlighting: https://github.com/zsh-users/zsh-syntax-highlighting
#
# For more plugins search this repo: https://github.com/unixorn/awesome-zsh-plugins
# 256 color mode
@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 / convertTwoSpacesToFour.sublime-macro
Created June 4, 2013 15:50
Sublime: Convert 2 Spaces to 4
[
{
"args": null,
"command": "select_all"
},
{
"args":
{
"set_translate_tabs": true
},
@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 / 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 / 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)