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
def r(new_value, old_values): | |
if len(old_values) > 10: | |
old_values.pop(0) | |
old_values.append(new_value) | |
average = sum(old_values) / len(old_values) | |
return average, old_values | |
history = [] | |
for i in range(100): |
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/local/bin/python3 | |
rules = [ | |
[ | |
# A required field and default value | |
'not "replication_factor" in configuration', | |
'configuration["replication_factor"] = 1' | |
], | |
[ | |
# production environments require at least 6 partitions |
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
# Use jq to read the terraform state file | |
# all id's | |
jq '.resources[].instances[].attributes.id?' terraform.tfstate | |
# all display names | |
jq '.resources[].instances[].attributes.display_name?' terraform.tfstate | |
# all environment id's | |
jq '.resources[].instances[].attributes.environment[]?.id' |
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
DROP table a; | |
DROP table b; | |
create table a ( | |
aid NUMBER(10), | |
adiz VARCHAR2(10) | |
); | |
create table b ( | |
bid NUMBER(10), |
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
## Chapter 1: 1970s | |
The Oregon Trail | |
Pong | |
Breakout | |
Boot Hill | |
Combat | |
Space Invaders | |
Adventure | |
Asteroids | |
Galaxian |
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
mith | |
jones | |
williams | |
brown | |
wilson | |
taylor | |
johnson | |
white | |
martin | |
anderson |
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
Hydrogen | |
Helium | |
Lithium | |
Beryllium | |
Boron | |
Carbon | |
Nitrogen | |
Oxygen | |
Fluorine | |
Neon |
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
import sys | |
import json | |
import urllib2 | |
import csv | |
import gzip | |
from collections import OrderedDict | |
def send_webhook_request(url, body, user_agent=None): | |
if url is None: |
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
data.rows.map(function (row) { | |
var _row = {}; | |
for (var f=0; f<data.fields.length; f++) { | |
fn = data.fields[f].name; | |
_row[fn] = row[f]; | |
} | |
return(_row); | |
}); |
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
import time # need for sleep | |
from xml.dom import minidom | |
import requests | |
from requests.packages.urllib3.exceptions import InsecureRequestWarning | |
requests.packages.urllib3.disable_warnings(InsecureRequestWarning) | |
base_url = 'https://localhost:8089' | |
username = 'admin' | |
password = 'changeme' |
NewerOlder