- Terminal output to file: https://askubuntu.com/a/420983
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- Pull in the wezterm API | |
| local wezterm = require 'wezterm' | |
| -- This will hold the configuration. | |
| local config = wezterm.config_builder() | |
| -- This is where you actually apply your config choices. | |
| -- For example, changing the initial geometry for new windows: | |
| config.initial_cols = 120 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # from https://www.reddit.com/r/Ubuntu/comments/iu6gf9/comment/g5j12p3/?utm_source=share&utm_medium=web3x&utm_name=web3xcss&utm_term=1&utm_content=share_button | |
| 1. While logged into Windows normally, click the Start Button and type cmd | |
| 2. Right-click the result and select Run as administrator | |
| 3. Type this command and press ENTER: bcdedit /set {current} safeboot minimal | |
| 4. Restart the computer and enter BIOS Setup | |
| 5. Change the SATA Operation mode to AHCI from either IDE or RAID | |
| 6. Save changes and exit Setup and Windows will automatically boot to Safe Mode. | |
| 7. While in Safe Mode, Right-click the Windows Start Menu once more. Choose Command Prompt (Admin). | |
| 8. Type this command and press ENTER: bcdedit /deletevalue {current} safeboot |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // LZW-compress a string | |
| function lzw_encode(s) { | |
| var dict = {}; | |
| var data = (s + "").split(""); | |
| var out = []; | |
| var currChar; | |
| var phrase = data[0]; | |
| var code = 256; | |
| for (var i=1; i<data.length; i++) { | |
| currChar=data[i]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function memorySizeOf(obj: any) { | |
| const seen = new WeakSet<object>(); | |
| function sizeOf(value: any): number { | |
| if (value === null || value === undefined) return 0; | |
| const t = typeof value; | |
| if (t === "number" ) return 8; | |
| if (t === "boolean") return 4; | |
| if (t === "bigint" ) return 8; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # The initial version | |
| if [ ! -f .env ] | |
| then | |
| export $(cat .env | xargs) | |
| fi | |
| # My favorite from the comments. Thanks @richarddewit & others! | |
| set -a && source .env && set +a |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # For Grafana dashboard: https://grafana.com/grafana/dashboards/19458-wireguard-wirerest-jvm/ | |
| # put these under `metrics.configs.scrape_configs` | |
| - job_name: 'wirerest' | |
| metrics_path: '/actuator/prometheus' | |
| authorization: | |
| credentials: YOUR_WIREREST_TOKEN | |
| static_configs: | |
| targets: ['YOUR_WIREREST_IP:8081'] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # from: https://github.com/microsoft/WSL/issues/4401#issuecomment-670080585 | |
| # checks to see if we are in a windows or linux dir | |
| function isWinDir { | |
| case $PWD/ in | |
| /mnt/*) return $(true);; | |
| *) return $(false);; | |
| esac | |
| } | |
| # wrap the git command to either run windows git or linux |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Example: | |
| * | |
| * <ng-container *rerender='changingInput'> | |
| * this content will be re-rendered everytime `changingInput` changes | |
| * </ng-container> | |
| */ | |
| import { Directive, | |
| Input, |
Improved YARD CHEATSHEET http://yardoc.org
forked from https://gist.github.com/chetan/1827484 which is from early 2012 and contains outdated information.
Templates to remind you of the options and formatting for the different types of objects you might want to document using YARD.
NewerOlder