Bookmarks Toolbar
__firefox-test-items
__ tag = TERM & in toolbar
🏷__zzzz
🏷__firefox-test-bookmark
__ tag = "__notTERM" & in toolbar
🏷__not__zzzz
🏷__firefox-test-bookmark
This file contains 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
# List running EC2 instances filtered by `Name` tag | |
# | |
# params: | |
# $1 - optional string. Filters output by instances with `Name` tag containing the string | |
function ec2 { | |
aws ec2 describe-instances \ | |
--filter "Name=instance-state-name,Values=running" \ | |
--filter "Name=tag:Name,Values=*$1*" \ | |
--query "Reservations[].Instances[].{ | |
id: InstanceId, |
This file contains 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
## Global vars | |
export LESS='--buffers=128 --HILITE-UNREAD --ignore-case --LONG-PROMPT --max-back-scroll=15 --no-init --quiet --quit-at-eof --quit-if-one-screen --RAW-CONTROL-CHARS --status-column --tabs=4 --window=-4' | |
export FZF_DEFAULT_COMMAND='rg --files --no-ignore --hidden --follow --glob "!.git/*"' | |
export FZF_DEFAULT_OPTS='--height 50% --ansi --info=inline' | |
export EDITOR='/usr/local/bin/nvim' | |
## zinit | |
source ~/.zinit/bin/zinit.zsh |
This file contains 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
def foo(Object... args) { | |
def normalizedArgs = [] | |
if (args != null) { | |
if (args.size() == 1) { | |
normalizedArgs << args[0] | |
} else { | |
normalizedArgs += args.toList() | |
} | |
} | |
print('foo(varargs): ' + normalizedArgs.size() + ': ') |
This file contains 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
/** | |
* Class Wrapper allows to wrap and execute variable number of nested Closures. | |
* Immediately-wrapped closure is accessible inside the wrapper as variable `_`. | |
*/ | |
final class Wrapper { | |
private final List stack = [] | |
Wrapper leftShift(Closure c) { | |
c.resolveStrategy = Closure.DELEGATE_FIRST | |
stack << c |
This file contains 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
String getHostFromUrl(String url) { | |
url | |
.replaceAll('^[a-z]+://', '') | |
.replaceAll('(/.*)?$', '') | |
.replaceAll('(:[0-9]+)?$', '') | |
} | |
def getHostFromUrlSpec() { | |
expect: | |
getHostFromUrl('https://example.com:9999/path.ext') == 'example.com' |
This file contains 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
String f(Object... varArgs) { | |
List args = varArgs == null ? [null] : varArgs | |
Map named = args | |
? (args[0] instanceof Map ? args[0] : [:]) | |
: [:] | |
List positional = named ? args.drop(1) : args | |
"named: $named; positional: $positional; all: $args" | |
} |
This file contains 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 __generate() { | |
typeset -A themes=( | |
[molokai]="no=0:di=0;38;2;102;217;239:ln=0;38;2;249;38;114:ow=0:so=0;38;2;0;0;0;48;2;249;38;114:fi=0:tw=0:ex=1;38;2;249;38;114:mi=0;38;2;0;0;0;48;2;255;74;68:*~=0;38;2;122;112;112:pi=0;38;2;0;0;0;48;2;102;217;239:or=0;38;2;0;0;0;48;2;255;74;68:cd=0;38;2;249;38;114;48;2;51;51;51:bd=0;38;2;102;217;239;48;2;51;51;51:st=0:*.r=0;38;2;0;255;135:*.t=0;38;2;0;255;135:*.o=0;38;2;122;112;112:*.a=1;38;2;249;38;114:*.d=0;38;2;0;255;135:*.h=0;38;2;0;255;135:*.m=0;38;2;0;255;135:*.p=0;38;2;0;255;135:*.z=4;38;2;249;38;114:*.c=0;38;2;0;255;135:*.td=0;38;2;0;255;135:*.hs=0;38;2;0;255;135:*.mn=0;38;2;0;255;135:*.jl=0;38;2;0;255;135:*.ui=0;38;2;166;226;46:*.pl=0;38;2;0;255;135:*.ml=0;38;2;0;255;135:*.py=0;38;2;0;255;135:*.kt=0;38;2;0;255;135:*.el=0;38;2;0;255;135:*.ps=0;38;2;230;219;116:*.cc=0;38;2;0;255;135:*.gv=0;38;2;0;255;135:*.ts=0;38;2;0;255;135:*.vb=0;38;2;0;255;135:*.rb=0;38;2;0;255;135:*.di=0;38;2;0;255;135:*.rs=0;38;2;0;255;135:*.pp=0;38;2;0;255;135:*.xz=4;38;2;2 |
This file contains 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
void withOptionalDocker(String dockerImageName, Closure body) { | |
(dockerImageName | |
? { c -> withDockerContainer(image: dockerImageName) {c()} } | |
: { c -> c() } | |
)(body) | |
} | |
withOptionalDocker(shouldUseDocke() ? 'my-image' : null) { | |
sh 'doSomething' | |
} |
NewerOlder