CLICK ME
yes, even hidden code blocks!
print("hello world!")| #!/bin/sh | |
| echo "What should the Application be called (no spaces allowed e.g. GCal)?" | |
| read inputline | |
| name=$inputline | |
| echo "What is the url (e.g. https://www.google.com/calendar/render)?" | |
| read inputline | |
| url=$inputline |
| //the code below will embed replace [gist id=x] tags with an embedded gist similar to the way the Wordpress Gist | |
| //plugin works. I wrote this in order to import posts from Wordpress. See //GB: for the changes. | |
| //SPJ: Updated for compatibility with Ghost 0.6.4 | |
| /** | |
| * ### Read | |
| * Find a post, by ID, UUID, or Slug | |
| * | |
| * @public | |
| * @param {{id_or_slug (required), context, status, include, ...}} options |
| #List unique values in a DataFrame column | |
| pd.unique(df.column_name.ravel()) | |
| #Convert Series datatype to numeric, getting rid of any non-numeric values | |
| df['col'] = df['col'].astype(str).convert_objects(convert_numeric=True) | |
| #Grab DataFrame rows where column has certain values | |
| valuelist = ['value1', 'value2', 'value3'] | |
| df = df[df.column.isin(value_list)] |
| val sparkConf = new SparkConf().setMaster("local").setAppName("text") | |
| val sc = new SparkContext(sparkConf) | |
| val hadoopConf = sc.hadoopConfiguration | |
| //set the aws secret information | |
| hadoopConf.set("fs.s3.impl", "org.apache.hadoop.fs.s3native.NativeS3FileSystem") | |
| hadoopConf.set("fs.s3n.awsAccessKeyId","youraccesskeyid") | |
| hadoopConf.set("fs.s3n.awsSecretAccessKey","secretkey") | |
| #!/bin/bash | |
| # | |
| # usage ./clean.docker.registry.sh registryUrl login filterString | |
| # | |
| # read the password | |
| echo -n Password: | |
| read -s password | |
| user="$2:${password}" |
| #!/usr/bin/python | |
| # connect2beam is a script that finds Erlang nodes and connects to them or | |
| # kills them. | |
| # | |
| # Example for connection: | |
| # | |
| # $ connect2beam | |
| # Available nodes: index name (cookie, pid) | |
| # |
| kubectl get secrets -o json --namespace old | jq '.items[].metadata.namespace = "new"' | kubectl create -f - |
| Add the following in .zshrc: | |
| ... | |
| plugins=(osx git zsh-autosuggestions zsh-syntax-highlighting zsh-nvm docker kubectl) | |
| ... | |
| ### Fix slowness of pastes with zsh-syntax-highlighting.zsh | |
| pasteinit() { | |
| OLD_SELF_INSERT=${${(s.:.)widgets[self-insert]}[2,3]} | |
| zle -N self-insert url-quote-magic # I wonder if you'd need `.url-quote-magic`? |
| #!/bin/bash | |
| # Scale DOWN all Turbonetes PODs to 0 | |
| function turbo_stop_all_pods { | |
| turbo_stop_all_pods=$(kubectl get deploy -n turbonomic --no-headers=true | cut -d ' ' -f1 | xargs -I % kubectl scale --replicas=0 deployment/% -n turbonomic) | |
| while true; do | |
| if `kubectl get pods -n turbonomic | grep -v STATUS | wc -l` -gt 0 then | |
| echo -e "turbo_STOP_all_pods: Waiting on Turbonetes POD(s) to TERMINATE, so far: \n`kubectl get pods -n turbonomic | grep -v NAME`" | |
| elif | |
| [[ "$counter" -gt 30 ]]; then; | |
| echo "MAX Counter Reached! One or more PODs are stuck ##TERMINATING##, intervening to kill it/them" |