-
clone this repository
git clone https://gist.github.com/wookietreiber/290e909a39cf7a02c8e89290e6fc4fed git-extract -
make
git-extractscript available to your shell
mkdir -p ~/bin
| #!/usr/bin/env bash | |
| set -efu -o pipefail | |
| # returns staged files | |
| function staged.files { | |
| if git rev-parse --verify HEAD &> /dev/null | |
| then | |
| against=HEAD | |
| else |
| suppressMessages(library(lintr)) | |
| files <- commandArgs(trailingOnly = T) | |
| messages <- function(file) { | |
| result <- lint(file) | |
| print(result) | |
| return(length(result)) | |
| } |
| #!/bin/bash | |
| if git rev-parse --verify HEAD &> /dev/null ; then | |
| against=HEAD | |
| else | |
| against=4b825dc642cb6eb9a060e54bf8d69288fbee4904 | |
| fi | |
| files=$( | |
| git diff-index --cached --name-only $against | |
| #!/bin/bash | |
| export SPLIT_header_n=$1 | |
| target_size=$2 | |
| export SPLIT_input_file=$3 | |
| target_wo_header=$(( "$target_size" - "$SPLIT_header_n" )) | |
| [[ -n $SPLIT_input_file ]] || { | |
| echo "usage: $(basename "$0") SPLIT_header_n target_n SPLIT_input_file" >&2 |
| import java.util.{ Random => JRandom } | |
| import java.util.concurrent.atomic.AtomicLong | |
| import scala.util.Random | |
| val rng = new Random | |
| val seedField = classOf[JRandom].getDeclaredField("seed") | |
| seedField.setAccessible(true) | |
| val seed = seedField.get(rng.self).asInstanceOf[AtomicLong].get |
| --- src/cxx/lib/io/Xml.cpp 2018-01-05 14:12:25.000000000 -0500 | |
| +++ src/cxx/lib/io/Xml.cpp 2018-01-05 14:12:35.000000000 -0500 | |
| @@ -168,19 +168,11 @@ | |
| if (!tree.empty()) | |
| { | |
| unindex(*tree.begin(), treeWithIndexAttributes); | |
| -#ifndef WIN32 | |
| - boost::property_tree::write_xml(os, treeWithIndexAttributes, boost::property_tree::xml_writer_make_settings(' ', 2)); | |
| -#else | |
| boost::property_tree::write_xml(os, treeWithIndexAttributes, boost::property_tree::xml_writer_make_settings<std::string>(' ', 2)); |
This Ansible guide discusses several approaches on how to set different
role default variables
based / depending on the host operating system aka ansible_distribution /
ansible_facts.distribution or other variables. For example, a role
variable image_uri should point to the latest cloud image for the host.
For CentOS 8 or Red Hat Enterprise Linux (RHEL) 8 the default value
should be: