Skip to content

Instantly share code, notes, and snippets.

View sbrinkmeyer's full-sized avatar
🏠
Working from home

s.brinkmeyer sbrinkmeyer

🏠
Working from home
View GitHub Profile
@sbrinkmeyer
sbrinkmeyer / numers.py
Created March 2, 2018 20:25
to see if an array has 2 numbers in it that add up to a search number. i was originally struggling with how to iterate through the array multiple times for the two numbers bit. then flying home i realized, hey i can cheat and iterate once through the array using a temp array to just subtract for finding the other number
numers = [ 2, 5, 8, 9, 13, 6, 22 ]
search_numer = 22
def funcyChicken(numberList=None,searchNumber=None):
retValue=False
temp_list = numberList[:]
for x in range(0,len(numberList)-1):
print numberList[x]
del temp_list[x]
other=search_numer-numberList[x]
@sbrinkmeyer
sbrinkmeyer / numers.py
Created March 2, 2018 20:24
to see if an array has 2 numbers in it that add up to a search number.
numers = [ 2, 5, 8, 9, 13, 6, 22 ]
search_numer = 22
def funcyChicken(numberList=None,searchNumber=None):
retValue=False
temp_list = numberList[:]
for x in range(0,len(numberList)-1):
print numberList[x]
del temp_list[x]
other=search_numer-numberList[x]
data "aws_iam_policy_document" "build_agent_role_policy" {
statement {
sid="TrustPolicyToAllowEC2AssumeRoleAction"
effect="Allow"
actions = ["sts:AssumeRole"]
principals {
type = "Service"
identifiers = [
"ec2.amazonaws.com"
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "EC2NonResourceBasedPermissions",
"Action": [
"ec2:Describe*",
"ec2:CreateKeyPair",
"ec2:CreateTags",
"ec2:CreateSecurityGroup",
echo "hello"
// Catch cookbook changes not made by the 'pipeline' user
rules 'catch cookbook changes'
with priority=50
rule on action
when
parent_type = 'cookbook'
and
requestor_name != 'go-agent'
then
// Not passing a second parameter(notification string)
search(:node, "environment:Rustys_bag_o_stuff").each { |the_node| puts "node #{node['fqdn']}" unless the_node.nil? }