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
# .github/actions/my-action/Gemfile | |
# frozen_string_literal: true | |
source 'https://rubygems.org' | |
git_source(:github) {|repo_name| "https://github.com/#{repo_name}" } | |
gem 'json' |
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
var mutationObserver = new MutationObserver(function(mutations) { | |
mutations.forEach(function(mutation) { | |
Array.prototype.forEach.call(document.querySelectorAll('.zhc-markdown a'), function(el, i) { | |
el.setAttribute('target', '_blank') | |
}) | |
}) | |
}) | |
mutationObserver.observe(document.documentElement, { | |
childList: true, |
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
on subListsToOneList(l) | |
set newL to {} | |
repeat with i in l | |
set newL to newL & i | |
end repeat | |
return newL | |
end subListsToOneList | |
tell application "System Events" | |
set windowList to name of window 1 of (processes whose name is "Zoom") |
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
#!/bin/bash | |
set -euo pipefail | |
PN_PKG='pneumatic-tubes' | |
mkdir -p "/tmp/${PN_PKG}" | |
cd "/tmp/${PN_PKG}" || exit 1 | |
if [ ! -e node_modules/.bin/npx ] | |
then |
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
# merge master changes into branch | |
git -c "user.name=Circle CI" -c "user.email=example@example.com" pull --no-edit --no-ff origin refs/heads/master | |
# Get changed directories, assuming each dir is an app, you could also do a for loop after to check for certain files which define those directories as apps, e.g. if [ -f "$APP/app.json" ] | |
CHANGED_APPS=$(git diff --name-status master..$(git symbolic-ref --short HEAD) | awk '{print $2}' | xargs basename) | |
# run builds for $CHANGED_APPS |
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
#!/bin/sh | |
if [ "$1" = "config" ]; then | |
echo '{}' | |
fi | |
>&2 echo "$*" | |
exit 0 |
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
#!/usr/bin/env python3 | |
import json | |
def list_hook(pairs): | |
result = {} | |
for name, value in pairs: | |
if name in ('data', 'module', 'resource', 'provider', 'backend'): | |
result.setdefault(name, []).append(value) | |
else: |
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
#!/usr/bin/env python | |
import dateutil.parser | |
import operator | |
import pprint | |
import sys | |
with open(sys.argv[1]) as f: | |
log = f.readlines() |
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
define file_array() { | |
file { $name: | |
path => "$name", | |
ensure => file, | |
mode => '0644', | |
owner => 'root', | |
group => 'nagios', | |
} | |
} |
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
#!/bin/bash | |
if (( $RANDOM % 2 )); then | |
>&2 echo 'Random failure' | |
exit 1 | |
fi | |
exit 0 |