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
| #!/usr/bin/env bash | |
| # Download: raw file is in https://gist.github.com/unique-EJ/64b2f43dfb5489a52a020114b374ffdc | |
| # curl can download the URL. | |
| # Usage: no options, puts command snippets into the Bash initialization file. | |
| declare edit_file="$(cat <<"EOF" | |
| # Edit a file. Line numbers - Meta key (Alt, Cmd, or Esc), N. | |
| function edit_file () { | |
| [[ ! -f "$1" || ! -w "$1" ]] && return 1; |
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
| # Linux command-line - AWK text processing language program. | |
| awk $'BEGIN { print "Type decimal (input) values to have the converted hexadecimal value output. CTRL-d to end." }\n{ printf "%s%x\\n", "Hex: ", $0 }' |
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
| #!/bin/bash | |
| # Send text to Android device using ADB, emulating keyboard input. | |
| # Based on a script from https://android.stackexchange.com/a/105881/223695 | |
| # and extended to support special characters. | |
| # CC BY-SA 3.0 - Share under same license, attribute the creator, indicate changes. | |
| # From Matthijs Kooijman's answer, https://android.stackexchange.com/a/176590/359828 | |
| if [[ "$1" != "" ]] | |
| then | |
| TEXT="$1" |
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
| # Start application, and X server, on a remote machine (SSH). | |
| # ". Xserver.sh [app name]", "pgrep [app name]" | |
| if [ $# -ge 1 ]; then | |
| app="$@" # The positional parameters (app). | |
| session="startlxde-pi" | |
| commands="\ | |
| cd /tmp/; mkfifo -m 607 .command; | |
| env echo -e \"declare DISPLAY=:0; \$(which ${session}) & | |
| ${app}\" > .command & |
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
| fun main() { | |
| var season = "!" | |
| // Write your code below | |
| when (season) { | |
| "Winter" -> println("Grow kale.") | |
| "Spring" -> println("Grow lettuce.") | |
| "Summer" -> println("Grow corn.") | |
| "Fall" -> println("Grow pumpkins.") | |
| else -> println("Not a valid season.") | |
| } |