Skip to content

Instantly share code, notes, and snippets.

@veggiemonk
veggiemonk / bitbucket.sh
Last active March 6, 2021 14:46
Download all repos in bitbucket and extract Jenkinsfile
#!/usr/bin/env bash
# Best tips and tricks for bash ==> https://github.com/gruntwork-io/bash-commons
BASE_URL="https://git.netent.com/rest/api/1.0"
AUTHZ=${AUTHZ:?"AUTHZ var is not defined, it should contain the base64 encoded \`username:password\`"}
H_JSON="accept: application/json"
H_AUTHZ="Authorization: Basic $AUTHZ"
@veggiemonk
veggiemonk / generate-kubeflow-manifest.sh
Created September 13, 2020 10:15
Generate KubeFlow manifest
#!/usr/bin/env bash
command -v kfctl >/dev/null 2>&1 || { echo; echo >&2"command kfctl is missing"; exit 1; }
command -v wget >/dev/null 2>&1 || { echo; echo >&2"command wget is missing"; exit 1; }
# Set the following kfctl configuration file:
# Other config can be found here: https://www.kubeflow.org/docs/started/getting-started/
export CONFIG_URI="https://raw.githubusercontent.com/kubeflow/manifests/v1.1-branch/kfdef/kfctl_k8s_istio.v1.1.0.yaml"
# Set KF_NAME to the name of your Kubeflow deployment. You also use this
# value as directory name when creating your configuration directory.
@veggiemonk
veggiemonk / cloudSettings
Last active September 12, 2020 15:20
vscode
{"lastUpload":"2020-09-12T15:20:07.897Z","extensionVersion":"v3.4.3"}
@veggiemonk
veggiemonk / vimrc
Created September 8, 2020 21:42
vimrc
let $RTP=split(&runtimepath, ',')[0]
let $RC="$HOME/.vim/vimrc"
filetype plugin indent on
syntax on
set shiftwidth=4 tabstop=4 softtabstop=4 expandtab autoindent smartindent
set path=.,**
set backspace=start,eol,indent
set hidden
@veggiemonk
veggiemonk / migrate_reveal.sh
Created April 27, 2020 18:22
small bash scripts to migrate all slides
#!/usr/bin/env bash
rm -rf presentations
mkdir -p presentations
function create_html() {
local HTML='<!DOCTYPE html><html lang="en"><head><meta charset="UTF-8" /><meta name="viewport" content="width=device-width, initial-scale=1.0" /><title>Presentations</title></head><body><ul>'
@veggiemonk
veggiemonk / demo-cloud-run.sh
Created April 18, 2020 14:38
kth serverless demo
#!/bin/bash
set -xe
# Meant to be run in cloud shell
# Enable APIs if not already done
# gcloud services enable run.googleapis.com containerregistry.googleapis.com
echo
echo "download container image locally"
#include<stdio.h>
int main(void){
printf("Hello world\n");
return 0;
}
@veggiemonk
veggiemonk / install_font_scp.sh
Created July 2, 2015 13:07
install source code pro font in Ubuntu 14.04.2
#!/bin/sh
echo "installing fonts at $PWD to ~/.fonts/"
mkdir -p ~/.fonts/adobe-fonts/source-code-pro
git clone https://github.com/adobe-fonts/source-code-pro.git ~/.fonts/adobe-fonts/source-code-pro
# find ~/.fonts/ -iname '*.ttf' -exec echo \{\} \;
fc-cache -f -v ~/.fonts/adobe-fonts/source-code-pro
echo "finished installing"
@veggiemonk
veggiemonk / fetch.js
Last active March 13, 2020 08:35
fetch boilerplate
/**
* readRequestBody reads in the incoming request body
* Use await readRequestBody(..) in an async function to get the string
* @param {Request} request the incoming request to read from
*/
export async function readRequestBody(request:Request) {
const { headers } = request
const contentType = headers.get('content-type')
if (contentType != null) {
Hello - from /Users/julien/.vscode/extensions/jaredly.reason-vscode-1.7.7/bin.native
Previous log location: /var/folders/gv/91zw6nln3054s17v6xpj0c4h0000gn/T/lsp.log
Sending notification {"jsonrpc": "2.0", "method": "client/registerCapability", "params": {"registrations": [{"id": "watching", "method": "workspace/didChangeWatchedFiles", "registerOptions": {"watchers": [{"globPattern": "**/bsconfig.json"}, {"globPattern": "**/.merlin"}]}}]}}
Sending response {"id": 0, "jsonrpc": "2.0", "result": {"capabilities": {"textDocumentSync": 1, "hoverProvider": true, "completionProvider": {"resolveProvider": true, "triggerCharacters": ["."]}, "signatureHelpProvider": {"triggerCharacters": ["("]}, "definitionProvider": true, "typeDefinitionProvider": true, "referencesProvider": true, "documentSymbolProvider": true, "codeActionProvider": true, "executeCommandProvider": {"commands": ["reason-language-server.add_to_interface_inner"]}, "codeLensProvider": {"resolveProvider": true}, "documentHighlightProvider": true, "document