Skip to content

Instantly share code, notes, and snippets.

View dreadwarrior's full-sized avatar
📚
Currently totally into books 😊

tåmm¥ dreadwarrior

📚
Currently totally into books 😊
View GitHub Profile
@udondan
udondan / include_vars_merged
Last active June 15, 2023 17:57
Ansible action plugin "include_vars_merged". Same as "include_vars" but merges hashes instead of overriding

Why?

Current version of Ansible (1.7.1) does not merge hashes in the include_vars task even if told so via hash_behaviour = merge in your ansible.cfg. ansible/ansible#9116

This action plugin will merge hashes no matter how you have configured your hash_behaviour.

How to setup:

Save include_vars_merged.py to library/plugins/action/include_vars_merged.py

Save include_vars_merged to library/custom/include_vars_merged

@OleMchls
OleMchls / shrink.sh
Last active August 1, 2017 17:35
understanding ghostscript
gs \
-q -dNOPAUSE -dBATCH -dSAFER \
-sDEVICE=pdfwrite \
-dNumRenderingThreads=2 \
-dEmbedAllFonts=true \
-dSubsetFonts=true \
-dDownsampleColorImages=true \
-dColorImageDownsampleType=/Bicubic \
-dColorImageResolution=72 \
-dDownsampleGrayImages=true \
@simbo
simbo / provision-node.sh
Last active July 13, 2022 14:24
setup node.js with nvm within vagrant
##
# add this to your provision.sh
#
# [!] run as 'vagrant' like this:
# su vagrant -c "source ${PROVISION_DIR}/provision-node.sh"
#
# [!] please keep the echo messages. those actions could take some more time without any output, so let the user know.
##
# install latest nvm
@rossriley
rossriley / gist:fdc9f545a8f122215334
Last active August 29, 2015 14:17
Using Anchors and Refs for Bolt Contenttypes
pages:
name: Pages
singular_name: Page
field_defaults: &defaults
title:
type: text
class: large
slug:
type: slug
uses: title
@tmilos
tmilos / README.md
Last active August 16, 2025 04:44
Modified Preorder Tree Traversal

Modified Preorder Tree Traversal

Hierarchical data metrics that allows fast read operations on tree like structures.

Based on Left and Right fields that are set during tree traversal. When entered into node value is set to it's Left, when exiting node value is set to it's Right.

Sample implementation

@CMCDragonkai
CMCDragonkai / http_streaming.md
Last active September 23, 2025 21:29
HTTP Streaming (or Chunked vs Store & Forward)

HTTP Streaming (or Chunked vs Store & Forward)

The standard way of understanding the HTTP protocol is via the request reply pattern. Each HTTP transaction consists of a finitely bounded HTTP request and a finitely bounded HTTP response.

However it's also possible for both parts of an HTTP 1.1 transaction to stream their possibly infinitely bounded data. The advantages is that the sender can send data that is beyond the sender's memory limit, and the receiver can act on

@simbo
simbo / create-and-publish-a-node-package.md
Last active August 29, 2015 14:26
Create and publish a node package.

Create and publish a node package.

…or actually…

__How to create and publish a node package using JSHint and JSCS for linting, Mocha for testing, Istanbul for code coverage,

@maxvt
maxvt / infra-secret-management-overview.md
Last active October 18, 2025 19:45
Infrastructure Secret Management Software Overview

Currently, there is an explosion of tools that aim to manage secrets for automated, cloud native infrastructure management. Daniel Somerfield did some work classifying the various approaches, but (as far as I know) no one has made a recent effort to summarize the various tools.

This is an attempt to give a quick overview of what can be found out there. The list is alphabetical. There will be tools that are missing, and some of the facts might be wrong--I welcome your corrections. For the purpose, I can be reached via @maxvt on Twitter, or just leave me a comment here.

There is a companion feature matrix of various tools. Comments are welcome in the same manner.

@Faheetah
Faheetah / Jenkinsfile.groovy
Last active October 7, 2025 15:42
Jenkinsfile idiosynchrasies with escaping and quotes
node {
echo 'Results included as an inline comment exactly how they are returned as of Jenkins 2.121, with $BUILD_NUMBER = 1'
echo 'No quotes, pipeline command in single quotes'
sh 'echo $BUILD_NUMBER' // 1
echo 'Double quotes are silently dropped'
sh 'echo "$BUILD_NUMBER"' // 1
echo 'Even escaped with a single backslash they are dropped'
sh 'echo \"$BUILD_NUMBER\"' // 1
echo 'Using two backslashes, the quotes are preserved'
sh 'echo \\"$BUILD_NUMBER\\"' // "1"
FROM ubuntu:16.04
RUN PACKAGES="\
php-cli \
php-mysql \
php-intl \
php-xml \
php-curl \
php-dom \
" && \