Skip to content

Instantly share code, notes, and snippets.

View shredthaGNAR's full-sized avatar

Me shredthaGNAR

View GitHub Profile
@shredthaGNAR
shredthaGNAR / sim.cc
Created August 27, 2022 08:47 — forked from bwasti/sim.cc
/*
sim.cc
Compile:
g++ sim.cc -std=c++11 -lpheval -O3 -o sim -IPokerHandEvaluator/cpp/include -LPokerHandEvaluator/cpp/build
./sim
Run: (all arguments are optional, defaults to 9 player full runouts)
./sim [number of other players 1-8] [cards on the board 3-5] [top % highlighted] [number of runouts per hand]
e.g.
@shredthaGNAR
shredthaGNAR / aliases.zsh
Created September 4, 2022 00:13 — forked from CyberPunkCodes/aliases.zsh
Oh-My-Zsh - Best and Most Helpful - My Custom ZSH Aliases - Tips Hack Help Info Doc Tutorial
# Source Reload
alias reload.zsh="source ~/.zshrc"
alias reload.profile="source ~/.bash_profile"
alias reload.term="source ~/.bash_profile && source ~/.zshrc"
# cd
alias ..="cd .."
# ls
alias ll="ls -AlhG"
@shredthaGNAR
shredthaGNAR / enable-touch-id-for-sudo.md
Created September 21, 2022 10:10 — forked from windyinsc/enable-touch-id-for-sudo.md
macOS - Enable Touch ID for sudo

Enable Touch ID for sudo

Thanks to this awesome Six Colors post: Quick Tip: Enable Touch ID for sudo

The short of it:

  1. In your terminal go to cd /etc/pam.d/.
  2. Now open the sudo file with your favorite command-line/GUI text editor.
    • Note that if you open it via the command-line, you’ll need to use sudo itself to do so, since the file is (understandably) protected.
  3. With the sudo file open, add the following command below below the first line. auth sufficient pam_tid.so
@shredthaGNAR
shredthaGNAR / sublime-text-macos-context-menu.md
Created September 23, 2022 21:47 — forked from idleberg/sublime-text-macos-context-menu.md
“Open in Sublime Text” in macOS context-menu

This list has been updated for Big Sur (and later). Since I don't use these versions, this guide might still need further improvements. For older macOS versions, please see this older revision.

Open in Sublime Text

  • Open Automator
  • Quick Action
  • Set “Service receives selected” to files or folders in any application
  • Add a Run Shell Script action
  • Set the script action to /Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl -n "$@"
  • Set “Pass input” to as arguments
@shredthaGNAR
shredthaGNAR / airdropSorter.scpt
Created September 23, 2022 21:55 — forked from menushka/airdropSorter.scpt
A Folder Action script written in AppleScript used to separate AirDropped files into a different folder other than the default Downloads folder
property AIRDROP_FOLDER : "Path:to:AirDrop:Folder:in:Alias:format"
property QUARANTINE_KEY : "59"
property GET_QUARANTINE_COMMAND_START : "ls -l -@ '"
property GET_QUARANTINE_COMMAND_END : "' | tr '\\n' ' ' | sed 's/.*com\\.apple\\.quarantine\\s*\\(\\d*\\)/ \\1/' | awk '{$1=$1};1'"
on adding folder items to this_folder after receiving added_items
repeat with i from 1 to length of added_items
set current_item to item i of added_items
set quarantine_type to getQuarantineType(POSIX path of current_item)
@shredthaGNAR
shredthaGNAR / vscode-macos-context-menu.md
Created September 23, 2022 21:56 — forked from idleberg/vscode-macos-context-menu.md
“Open in Visual Studio Code” in macOS context-menu

Open in Visual Studio Code

  • Open Automator
  • Create a new document
  • Select Quick Action
  • Set “Service receives selected” to files or folders in any application
  • Add a Run Shell Script action
    • your default shell should already be selected, otherwise use /bin/zsh for macOS 10.15 (”Catalina”) or later
    • older versions of macOS use /bin/bash
  • if you're using something else, you probably know what to do 😉
@shredthaGNAR
shredthaGNAR / createFile.applescript
Created September 23, 2022 22:40 — forked from avaccari/createFile.applescript
Apple script to create a file with desired extension in a folder. Can be used in automator to create an app or a quick action.
(*
* An script to create a new empty file based on the current selection in Finder:
* - if there is nothing selected, it will create the file in the currently display folder
* - if a file is selected, it will create the file in the folder of the selected file
* - if a folder is selected, it will create the file in the selected folder
* - if an application is selected, it will not create the file
*
* By default the name extention of the file is .txt. If the function key
* is pressed while calling this script, the user will be prompted for the
* extension.
@shredthaGNAR
shredthaGNAR / macos-lifehacks.md
Created September 23, 2022 23:33 — forked from mieky/macos-lifehacks.md
MacOS Lifehacks

Collection of useful tips & tricks to set up on a Mac.

Safari: bind cmd+alt+arrows to switch between previous/next tab

defaults write -app Safari NSUserKeyEquivalents '{
"Show Next Tab" = "@~\\U2192";
"Show Previous Tab" = "@~\\U2190";
}'
@shredthaGNAR
shredthaGNAR / zsh-keyboard-shortucts.md
Created September 23, 2022 23:50 — forked from mkfares/zsh-keyboard-shortucts.md
Common zsh Keyboard Shortcuts on macOS Catalina

Common zsh Keyboard Shortcuts on macOS

Navigation

CTRL + A : Move the cursor to the beginning of the line
CTRL + E : Move the cursor to the end of the line
OPTION + Left Arrow : Move the cursor one word backward
OPTION + Right arrow : Move the cursor one word forward
Left Arrow : Move the cursor one character backward
Right Arrow : Move the cursor one character forward

@shredthaGNAR
shredthaGNAR / powerlevel9k.config
Created September 24, 2022 02:25 — forked from athityakumar/powerlevel9k.config
Powerlevel9k oh-my-zsh theme configuration for screenshots used in https://github.com/athityakumar/colorls
export ZSH=$HOME/.oh-my-zsh
export DEFAULT_USER='athityakumar'
TERM=xterm-256color
ZSH_THEME="powerlevel9k/powerlevel9k"
POWERLEVEL9K_MODE='awesome-fontconfig'
POWERLEVEL9K_PROMPT_ON_NEWLINE=true
POWERLEVEL9K_PROMPT_ADD_NEWLINE=true
POWERLEVEL9K_RPROMPT_ON_NEWLINE=true
POWERLEVEL9K_SHORTEN_DIR_LENGTH=2