Skip to content

Instantly share code, notes, and snippets.

View ragingprodigy's full-sized avatar
🏠
Working from home

Oladapo Bernard Omonayajo ragingprodigy

🏠
Working from home
View GitHub Profile
@ragingprodigy
ragingprodigy / splitCamelCase.js
Created December 9, 2020 17:48 — forked from JeffJacobson/splitCamelCase.js
Splits camelCase or PascalCase words into individual words.
/**
* Splits a Pascal-Case word into individual words separated by spaces.
* @param {Object} word
* @returns {String}
*/
function splitPascalCase(word) {
var wordRe = /($[a-z])|[A-Z][^A-Z]+/g;
return word.match(wordRe).join(" ");
}
@ragingprodigy
ragingprodigy / README.md
Last active October 25, 2018 10:10 — forked from adambom/README.md
Backup Kubernetes Cluster State

Run this in order to backup all you k8s cluster data. It will be saved in a folder bkp. To restore the cluster, you can run kubectl apply -f ${BACKUP_OUTPUT_DIR}.

Please note: this recovers all resources correctly, including dynamically generated PV's. However, it will not recover ELB endpoints. You will need to update any DNS entries manually, and manually remove the old ELB's.

Please note: This has not been tested with all resource types. Supported resource types include:

  • services
  • replicationcontrollers
  • secrets
  • deployments
  • horizontal pod autoscalers
// This will open up a prompt for text to send to a console session on digital ocean
// Useful for long passwords
(function () {
var t = prompt("Enter text to be sent to console, (This wont send the enter keystroke)").split("");
function f() {
var character = t.shift();
var i=[];
var code = character.charCodeAt();
var needs_shift = "!@#$%^&*()_+{}:\"<>?~|".indexOf(character) !== -1