Skip to content

Instantly share code, notes, and snippets.

@1v
1v / gist:cf0a74bf10fbe7a8c2fbb04337f6cf45
Last active December 15, 2022 23:17
Start Rails server with WSL and Windows Terminal on launch

Add this to Windows Terminal settings (Settings -> Open JSON file) after launchMode for example:

"startupActions": "new-tab -p Ubuntu wsl -- source ~/.bash_profile \\; cd ~/www/rails-project \\; bin/rails s \\; $SHELL; new-tab -p Ubuntu wsl -- source ~/.bash_profile \\; cd ~/www/rails-project \\; bin/webpack-dev-server \\; $SHELL; new-tab -p Ubuntu wsl -- source ~/.bash_profile \\; cd ~/www/rails-project \\; $SHELL"

Explanation:

Start rails server. Tab will not be closed if server stopped by user, because of $SHELL. Using source ~/.bash_profile because rvm not loaded without it

@1v
1v / _README.md
Last active October 15, 2022 13:08
wsl letter_opener gem setup
bash <(curl -sL https://gist.githubusercontent.com/1v/b21da42500389725af260c0e51c9f2dd/raw/wsl.sh)

Add:

BROWSER: 'wslopen'

to application.yml

@1v
1v / bestchange.user.js
Last active March 28, 2024 16:37
BestChange.ru - выделить избранные обменники
// ==UserScript==
// @name BestChange
// @namespace http://tampermonkey.net/
// @version 0.2
// @description Highlights favorite exchanges
// @homepage https://gist.github.com/1v/fa3d41bf43c63d960e2b48dd8312e340
// @match https://www.bestchange.ru/*
// @match https://www.bestchange.com/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=bestchange.ru
// @require https://code.jquery.com/jquery-3.7.1.min.js