Skip to content

Instantly share code, notes, and snippets.

View kbens's full-sized avatar
🟦

Kyle Benson kbens

🟦
View GitHub Profile
@kbens
kbens / bashrc.cloudshell.custom
Last active April 21, 2020 18:02
Example of adding Oracle Cloud Shell specific setup to custom bashrc file
# ...
# if $OCI_CLI_CONFIG_FILE is set, assume called from Oracle Cloud Shell
if [ -n $OCI_CLI_CONFIG_FILE ] then
# set my timezone
export TZ="/usr/share/zoneinfo/America/Chicago"
# set custom prompt
export PS1='\[\033[90m\]┌[\[\033[37m\]\t\[\033[90m\]]-[\[\033[32m\]\u\[\033[90m\] at ☁️ ]-[\[\033[35m\]$OCI_CLI_PROFILE\[\033[90m\]]\n└[\[\033[34m\]\w\[\033[90m\]]\[\033[36m\]$(__git_ps1 " [%s]") \[\033[37m\]$ '
# call delivered cloud shel bashrc
source /etc/bashrc.cloudshell
@kbens
kbens / Substring [peoplecode]
Last active August 14, 2020 15:12
String Manipulation in PeopleCode
Local string &foo = "This is a foo string.";
Local string &start_key = "Th";
Local string &end_key = ".";
Local integer &start_pos = Find(&start_key, &foo) + Len(&start_key);
Local integer &end_pos = Find(&end_key, &foo);
Local string &result = Substring(&foo, &start_pos, &end_pos - &start_pos);
/* &result will now equal "is is a foo string" */