Skip to content

Instantly share code, notes, and snippets.

View rashkur's full-sized avatar
:octocat:

Roman S rashkur

:octocat:
View GitHub Profile
@rashkur
rashkur / docker-destroy-all.sh
Created May 22, 2019 11:52 — forked from JeffBelback/docker-destroy-all.sh
Destroy all Docker Containers and Images
#!/bin/bash
# Stop all containers
docker stop $(docker ps -a -q)
# Delete all containers
docker rm $(docker ps -a -q)
# Delete all images
docker rmi $(docker images -q)
# Homebrew has done away with options in all of their core formulas
# discussion on this change here: https://github.com/Homebrew/homebrew-core/issues/31510
# install it like this:
brew install https://gist.githubusercontent.com/rashkur/cfcc377bd378fb709dff949fcf5bb889/raw/3333ea8f44cee6ed54a1a134dab99599dc32b6ae/ffmpeg.rb \
--with-aom \
--with-chromaprint \
--with-fdk-aac \
--with-fontconfig \
--with-freetype \
@rashkur
rashkur / undefinedVariable.groovy
Created September 23, 2020 15:23 — forked from pradhyu/undefinedVariable.groovy
Check if a variable is undefined in groovy
// checking bindings snippets
if (binding.hasVariable('superVariable')) {
// your code here
}
An easy solution to this is the following:
if (binding.variables.containsKey("bindingVar")) {
// do something
}
Or if you’d like to get a null value for an optional binding: