parse_git_branch() { git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* (.*)/ [\1]/' }
export PS1="\u@\h \W[\033[01;33m]$(parse_git_branch)[\033[00m] $ "
Here are some other terminal colour codes you can use:
Some other cool options:
CREATE OR REPLACE FUNCTION SYSDATEUTC RETURN DATE AS | |
BEGIN | |
RETURN CAST(sys_extract_utc(SYSTIMESTAMP) AS DATE); | |
END SYSDATEUTC; |
ruby -e "require 'securerandom'; puts SecureRandom.uuid" |
sudo apt-get -s dist-upgrade | grep "^Inst" | grep -i securi | awk -F " " {'print $2'} | xargs sudo apt-get install -y |
-- taken from: https://dba.stackexchange.com/questions/171739/change-owner-of-all-schema-objects | |
CREATE OR REPLACE FUNCTION public.chown(in_schema character varying, new_owner character varying) | |
RETURNS void | |
LANGUAGE plpgsql | |
AS $function$ | |
DECLARE | |
object_types VARCHAR[]; | |
object_classes VARCHAR[]; | |
object_type record; |
extension Double { | |
func reduceScale(to places: Int) -> Double { | |
let multiplier = pow(10, Double(places)) | |
let newDecimal = multiplier * self // move the decimal right | |
let truncated = Double(Int(newDecimal)) // drop the fraction | |
let originalDecimal = truncated / multiplier // move the decimal back | |
return originalDecimal | |
} | |
} |
# all | |
kubectl get pods --all-namespaces | grep -E 'ImagePullBackOff|ErrImagePull|Evicted|Terminating' | awk '{print $2 " --namespace=" $1}' | xargs kubectl delete pod --grace-period=0 --force | |
# not terminated | |
kubectl get pods --all-namespaces | grep -E 'ImagePullBackOff|ErrImagePull|Evicted' | awk '{print $2 " --namespace=" $1}' | xargs kubectl delete pod --grace-period=0 --force | |
# manual scaling adjustment | |
kubectl scale --replicas=0 deployment <deployment> |
public class Person { | |
public string FirstName { get; set; } | |
public string LastName { get;set; } | |
public int Age { get; set; } | |
public async Task Finalize() { | |
// does something does not matter what | |
} | |
} |
import { Component } from '@angular/core'; | |
import { of } from 'rxjs'; | |
import { tap, switchMap} from 'rxjs/operators'; | |
import { retryBackoff } from 'backoff-rxjs'; | |
import { BackendService, HttpError } from './backend.service'; | |
export const INIT_INTERVAL_MS = 100; // 100 ms | |
export const MAX_INTERVAL_MS = 20 * 1000; // 20 sec | |
@Component({ |
$ServiceName = 'Serenade' | |
$arrService = Get-Service -Name $ServiceName | |
while ($arrService.Status -ne 'Running') | |
{ | |
Start-Service $ServiceName | |
write-host $arrService.status | |
write-host 'Service starting' | |
Start-Sleep -seconds 5 |