Skip to content

Instantly share code, notes, and snippets.

@idleberg
idleberg / vscode-macos-context-menu.md
Last active April 25, 2024 07:14
“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 😉
@rightson
rightson / OpenWithSublimeText3-Full.bat
Created May 23, 2021 15:43
Open With Sublime Text 3 Full Version
@echo off
SET st3Path=C:\Program Files\Sublime Text 3\sublime_text.exe
rem add it for all file types
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 3" /t REG_SZ /v "" /d "Open with Sublime Text 3" /f
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 3" /t REG_EXPAND_SZ /v "Icon" /d "%st3Path%,0" /f
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 3\command" /t REG_SZ /v "" /d "%st3Path% \"%%1\"" /f
rem add it for folders
@reg add "HKEY_CLASSES_ROOT\Directory\shell\Open with Sublime Text 3" /t REG_SZ /v "" /d "Open with Sublime Text 3" /f
@ilbunilcho
ilbunilcho / How to remove Windows paths from WSL path.md
Created November 1, 2018 16:41
How to remove Windows paths from WSL path

after Build 17093

  • can override settings by edit "/etc/wsl.conf"
  • normally this file is not exists at first
$ sudo vi /etc/wsl.conf

[interop]
appendWindowsPath = false
@rightson
rightson / router.sh
Last active October 25, 2018 07:43
A helper for simplifying and remembering the add/route default gateway commands
#!/bin/bash
CONFIG=~/.route.conf
function usage() {
echo -e "Usage: `basename $0` <options>\noptions:"
grep "^function" $0 | sed 's/function/ /g' | sed 's/[{()]//g'
}
function list() {
@rightson
rightson / sslvpn.sh
Last active October 24, 2018 13:39
Pulse Secure Client Wrapper for Ubuntu (for Pulse-Secure-8.2R5) with simple usename/hostname cache
#!/bin/bash
CLIENT=/usr/local/pulse/PulseClient.sh
CONFIG=~/.sslvpn.conf
function usage() {
echo -e "Usage: `basename $0` <options>\noptions:"
grep "^function" $0 | sed 's/function/ /g' | sed 's/[{()]//g'
}
@rightson
rightson / vue.config.js
Created August 7, 2018 08:03
vuel-cli 3.x proxy setting (different from 2.x's proxyTable setting)
module.exports = {
devServer: {
proxy: {
'/api': {
target: 'http://localhost:8000/api',
changeOrigin: true,
ws: true,
pathRewrite: {
'^/api': ''
}
@rightson
rightson / register-gitea-as-service.bat
Last active July 10, 2018 02:36
Register gitea as a windows service
rem Register command
sc create Gitea start= auto binPath= ""D:\Applications\gitea\gitea.exe" web --config "D:\Applications\gitea\my-app.ini""
rem De-register command
sc delete Gitea
@rightson
rightson / ubuntu-mate-18.04-provisioning.sh
Last active July 10, 2018 02:37
My quick provisioning script for Ubuntu MATE 18.04
echo 'Adding repository of sierra theme ...'
sudo add-apt-repository ppa:dyatlov-igor/sierra-theme -y
echo 'Adding repository of spotify ...'
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 0DF731E45CE24F27EEEB1450EFDC8610341D9410 931FF8E79F0876134EDDBDCCA87FF9DF48BF1C90
echo deb http://repository.spotify.com stable non-free | sudo tee /etc/apt/sources.list.d/spotify.list
echo 'Updating apt ...'
sudo apt update
@hisplan
hisplan / add-rsync-to-git-bash.md
Created February 21, 2018 09:02
Add rsync to git bash for windows
@elit8888
elit8888 / res_adjust.md
Last active February 1, 2024 23:16
Use keyboard shortcut to adjust resolution higher or lower in MacOS

Resolution Adjustment Shortcut Setup

This note illustrates how to adjust resolution using keyboard shorcut using built-in app automator. After setting up, I can use two actions:

  • Switch to Highest resolution
  • Switch to Default resolution

I'm new to apple script, so the rule is very simple.

References: