This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Perform a best effort extraction of up to two initials from a space delimited name string | |
* @param {string} text The text | |
* @return {string} The result | |
*/ | |
function initials(text) { | |
if (!text) { | |
return "" | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
kubectl exec db-mongodb-replicaset-0 -- sh -c 'mongo --quiet --eval="printjson(rs.isMaster().primary)"' | sed 's/"//g' | awk -F\. '{print $1}' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export PATH=$(brew --prefix coreutils)/libexec/gnubin:/usr/local/bin:/usr/local/sbin:$PATH | |
export GOPATH=$HOME/go | |
export LSCOLORS=gxBxhxDxfxhxhxhxhxcxcx | |
export CLICOLOR=1 | |
alias k=kubectl | |
alias cat=bat | |
alias preview="fzf --preview 'bat --color \"always\" {}'" | |
# add support for ctrl+o to open selected file in VS Code |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
find . -name node_modules -type d -maxdepth 2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
if [ "$1" = "" ]; then | |
echo "Usage: ./ksh <pod>" | |
exit 1 | |
fi | |
echo Getting pods... | |
PODS=$(kubectl get pods --no-headers --output=name | grep $1) | |
PODS=(${PODS}) | |
NUM_PODS=${#PODS[@]} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
find . -name 'node_modules' -type d -prune -exec du -sh {} + |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// From https://github.com/kirankalyan5/react-native-segmented-control-tab | |
// Added enabled prop | |
// Use Material theme Indigo color defaults | |
// Add propType validation | |
// Lower opacity for disabled | |
// Fix border and width issues for Android | |
import React from "react" | |
import { | |
View, | |
ViewPropTypes, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
( function(root, factory) { | |
root.pubsub = factory(root); | |
}(this, function() { | |
var publishEmitter; | |
var directory; | |
var eventStream; | |
var SubscriptionDefinition = function(stream, callback) { | |
this.stream = stream; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const myCoolFunc = () => { | |
const name = new Error().stack.match(/at (.*?) /)[1] | |
console.log(name) // myCoolFunc | |
} |