Skip to content

Instantly share code, notes, and snippets.

@zmaupin
zmaupin / .block
Created May 13, 2020 14:42 — forked from d3noob/.block
Simple d3.js bar chart
license: mit
def symmetrical_difference(arr1, arr2)
arr = []
arr2.length.times do |index|
arr << arr2[index] if arr1.include?(arr2[index]) && !arr.include?(arr2[index])
arr << arr1[index] if arr2.include?(arr1[index]) && !arr.include?(arr1[index])
end
arr
end
@zmaupin
zmaupin / maximum_pairwise_product.py
Created October 9, 2019 02:15
Maximum Pairwise Product Algorithm
# maximum pairwise product
# find the maximum product of two distinct numbers in a sequence of
# non-negative integers
# input: sequence of non-negative integers
# output: maximum value that can be obtained by multiplying two different
# elements from the sequence
import random
def maximum_pairwise_product(a):

Managing the monitoring attribute on Chef nodes

Disabling monitoring

tl;dr

Add the role disabled_monitoring to your node. Run chef-client on the node.

How can I do that?

def multiples?(first_number, second_number, limit)
i = 1
multiples = []
while i < limit
multiples << i if i % first_number == 0 || i % second_number == 0
i += 1
end
# p "multiples of: #{number} - up to: #{limit}"
multiples
end