Skip to content

Instantly share code, notes, and snippets.

@JM-Mendez
JM-Mendez / git_stash.sh
Last active February 18, 2021 06:01
git stash only one file #git
git stash push -m "message" -- path_to_file.ext
@JM-Mendez
JM-Mendez / READ_ME.md
Last active June 28, 2021 18:21
Custom mac display custom resolution
  1. enable HiDpi if required
  2. install RDM latest release
  3. set custom resolution using RDM

Hack until apple fixes hidpi

https://forums.macrumors.com/threads/scale-1680x1050-on-rmb-without-an-app.1873910/page-17?post=29863160#post-29863160

SwitchResX -> create a custom resolution for INTERNAL display. Make it 2x the resolution you want, i.e. 3840x2160 for 1080p. Save it and reboot.

Then, connect your laptop up to your monitor. Select the SwitchResX icon in the menu bar at the top. Activate the custom HIDPI res for your internal monitor.

@JM-Mendez
JM-Mendez / kill_ports.shell
Last active April 5, 2021 18:18
Kill ports on #windows
netstat -ano | findstr :<yourPortNumber>
taskkill /F /PID <typeyourPIDhere>
@JM-Mendez
JM-Mendez / frankenraw.zsh-theme
Last active December 2, 2020 04:54 — forked from cravacuore/raw.zsh-theme
Zsh 'raw' theme [ZSH theme] #zsh #theme
# Copied and modified from https://dev.to/cravacuore/comment/i7g0
# Inspired by making a mixture the following themes:
# robbyrussell + arrow + lambda
# changing some colors and elements positions
local ret_status="%(?:%{$fg_bold[grey]%}λ :%{$fg_bold[red]%} λ )"
# ellipsis https://github.com/ohmyzsh/ohmyzsh/issues/7525#issuecomment-456074298
PROMPT=' ${ret_status}%{$fg[magenta]%}%c %{$fg[black]%}git:(%{$fg[cyan]%}%30>...>$(git_current_branch)%>>%{$fg[black]%}$(parse_git_dirty)%{$reset_color%} ➤ %{$reset_color%}'
// add this to top of file
console.log('\u001b[2J\u001b[0;0H');
@JM-Mendez
JM-Mendez / mklink.psm1
Created November 19, 2020 01:07 — forked from jpoehls/mklink.psm1
Native PowerShell wrapper for MKLINK.
@JM-Mendez
JM-Mendez / install-zsh-windows-git-bash.md
Created November 16, 2020 17:15 — forked from fworks/install-zsh-windows-git-bash.md
Zsh / Oh-my-zsh on Windows Git Bash
@JM-Mendez
JM-Mendez / cmder.md
Created November 3, 2020 14:36 — forked from nickautomatic/cmder.md
Setting up Cmder to use bash by default

Set up cmder to use msysgit / bash by default

  • Install cmder_mini (msysgit is already installed, so no need for full version)
  • In Cmder, open settings: Win + Alt + P
  • Under Startup > Tasks, add a task called {bash} with the following settings:
    • Task parameters (set icon):
      • For Cmder icon: /icon "%CMDER_ROOT%\cmder.exe"
      • For Git icon: /icon "C:\Program Files (x86)\Git\etc\git.ico"
    • Commands (open Git's bash shell):
  • "C:\Program Files (x86)\Git\bin\sh.exe" -l -new_console:d:%USERPROFILE%
@JM-Mendez
JM-Mendez / autopush.zsh
Created July 9, 2020 20:16
Autopush git repo on every commit
# adapted from https://stackoverflow.com/a/28042939
branch_name=$(git symbolic-ref --short HEAD)
retcode=$?
# Only push if branch_name was found (my be empty if in detached head state)
if [ $retcode -eq 0 ] ; then
#Only push if branch_name does not end with the non-push suffix
if [[ $branch_name != 'dev' && $branch_name != 'master' ]] ; then
echo
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions