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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Maths Group - Negative Numbers</title> | |
<style> | |
.header-body { | |
width: 100%; | |
height: 100%; | |
text-align: center; |
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 re | |
from hypothesis import given, strategies as st | |
EMAIL_REGEX = re.compile(r'[a-zA-Z0-9_.-]+@[a-zA-Z0-9-]+.[a-zA-Z0-9-.]+') | |
def validate_email(email): | |
""" Validates an email address""" | |
if EMAIL_REGEX.match(email): |
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 json | |
import sys | |
import elasticsearch | |
def send_to_es(payload, _id, list_name): | |
es = elasticsearch.Elasticsearch() | |
es.index(index=list_name, doc_type='item', id=_id, body=payload) | |
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 socket | |
import subprocess | |
import sys | |
url = str(sys.argv[1]) | |
remoteIp = socket.gethostbyname(url) | |
print "Scanning " + url + " (" + remoteIp + ")" | |
try: | |
for port in range(1,5000): |
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 requests | |
import os, sys | |
url = sys.argv[1] | |
dicts_dir = sys.argv[2] | |
result_dir = sys.argv[3] | |
def import_dict(dir, filepath): | |
file = open(os.path.join(dir,filepath), 'r') | |
return [item for item in file] |
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 requests, json, time, os | |
ABS_URL = 'http://www.abs.gov.au/api/demography/populationprojection' | |
def getData(): | |
r = requests.get(ABS_URL) | |
return json.loads(r.text) | |
def getPopulation(): | |
text = getData() |
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
param ( | |
[Parameter(Mandatory=$true)][string]$Hostname | |
) | |
$failure = "" | |
while (!$failure) { | |
try { | |
$net = [System.Net.Dns]::GetHostAddresses($Hostname) | |
$Host.UI.RawUI.BackgroundColor = ($bckgrnd = 'DarkGreen') | |
} catch [Exception] { | |
$failure = "yes" |
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 os | |
import copy | |
from PIL import Image | |
from pyPdf import PdfFileWriter, PdfFileReader | |
def append_pdf(input,output): | |
[output.addPage(input.getPage(page_num)) for page_num in range(input.numPages)] | |
output = PdfFileWriter() | |
cwd = os.getcwd() |
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
#inspired by http://cube-drone.com/comics/c/version-sacrifice | |
# note: you'll need to pip install pygithub | |
import time | |
import urllib2 | |
import random | |
from github import Github | |
def nvl(var, val): | |
if var is None: | |
return val |
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
for /f "delims=" %%d in ('dir /s /b /ad ^| sort /r') do rd "%%d" |