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 add_or_change { | |
TARGET_KEY=$1 | |
REPLACEMENT_VALUE=$2 | |
CONFIG_FILE=$3 | |
if grep -e "^\s*$TARGET_KEY\s*=" "$CONFIG_FILE"; then | |
sed -i 's/^\('"$TARGET_KEY"'\s*=\s*\).*$/\1'"$REPLACEMENT_VALUE"'/' $CONFIG_FILE | |
grep -e "^\s*$TARGET_KEY\s*=" "$CONFIG_FILE" | |
else | |
echo "$TARGET_KEY=$REPLACEMENT_VALUE" >> "$CONFIG_FILE" | |
fi |
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
{ | |
"global": { | |
"check_for_updates_on_startup": true, | |
"show_in_menu_bar": true, | |
"show_profile_name_in_menu_bar": false | |
}, | |
"profiles": [ | |
{ | |
"complex_modifications": { | |
"parameters": { |
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
// https://forum.golangbridge.org/t/slice-pass-as-value-or-pointer/2866/2 | |
package main | |
import ( | |
"fmt" | |
"reflect" | |
"encoding/json" | |
) | |
type TTT struct { | |
arr []int |
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
test |