Recommendation: use together with https://github.com/andywer/pg-listen
See also: https://gist.github.com/colophonemes/9701b906c5be572a40a84b08f4d2fa4e
kind: Namespace | |
apiVersion: v1 | |
metadata: | |
name: demo | |
labels: | |
name: demo | |
--- | |
apiVersion: apps/v1 | |
kind: Deployment | |
metadata: |
#!/usr/bin/env python3 | |
''' | |
Rename computer from remote CSV using Jamf binary | |
Pass in the URL to your remote CSV file using script parameter 4 | |
The remote CSV could live on a web server you control, OR be a Google Sheet | |
specified in the following format: | |
https://docs.google.com/spreadsheets/u/0/d/<document ID>/export?format=csv&id=<document ID>&gid=0 | |
''' | |
#!/bin/bash | |
export AWS_ACCESS_KEY_ID= | |
export AWS_SECRET_ACCESS_KEY= | |
export AWS_DEFAULT_REGION= | |
buckets_wsv=$(aws s3api list-buckets --query "Buckets[].Name" --output text) | |
echo $buckets_wsv | |
echo | |
echo "---" |
require "base64" | |
question, hints, solution = DATA.read.split("__END__") | |
puts Base64.decode64(hints) | |
puts question | |
__END__ | |
Frage: Wer bin ich? |
const filter = 'node.1.response.queue' // e.g. when someone used foo-foo-mq with replyQueue:true defaults | |
const baseUrl = 'http://rabbitmq:15762' | |
let pageIdx = 1 | |
let shouldFetchAnotherPage = true | |
while (shouldFetchAnotherPage) { | |
console.log('Fetching queues page ' + pageIdx) | |
const queues = await (await fetch(`${baseUrl}/api/queues?page=1&page_size=500&name=${filter}&use_regex=false&pagination=true`)).json() | |
shouldFetchAnotherPage = queues.page_count > 1 | |
for (const queue of queues.items) { | |
if (queue.name.match(new RegExp(filter))) { |
drush php-eval "module_load_install('MYMODULE'); MYMODULE_update_NUMBER();" | |
# or | |
drush php:cli | |
require 'core/modules/taxonomy/taxonomy.post_update.php'; | |
taxonomy_post_update_add_unpublished_nodes_to_taxonomy_index($sandbox); |
<?php | |
function urlSafeBse64Encode($string) { | |
$data = base64_encode($string); | |
# base64 strings can end in several = chars. These need to be translated into a number | |
$no_of_eq = substr_count($data, "="); | |
$data = str_replace("=", "", $data); | |
$data = $data.$no_of_eq; | |
# then replace all non-url safe characters | |
$data = str_replace(array('+','/'), array('-','_'), $data); |
Recommendation: use together with https://github.com/andywer/pg-listen
See also: https://gist.github.com/colophonemes/9701b906c5be572a40a84b08f4d2fa4e
module FlatTransformer | |
# @param [Hash, Array, String, Fixnum] | |
# @return [Enumerator, #to_a] enumerator, call #to_a to get it as array | |
def self.deep_flatten_jsonpath(data, max_depth=nil) | |
Enumerator.new do |enum| | |
depth = 0 | |
queue = [{ path: [], value: data }] | |
while queue.length > 0 | |
current = queue.shift | |
is_allowed_to_go_deeper = (!max_depth || depth < max_depth) |
const { Readable, Transform, pipeline } = require('stream') | |
const createCounterReader = () => { | |
let count = 0; | |
return new Readable({ | |
objectMode: true, | |
read() { | |
count += 1; | |
console.log('read', count) | |
this.push({count}); |