Skip to content

Instantly share code, notes, and snippets.

View RootPat's full-sized avatar

Patrick Harris RootPat

View GitHub Profile
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from bs4 import BeautifulSoup
import time
import pandas as pd
driver = webdriver.Chrome('/Users/patrickharris/Desktop/chromedriver/chromedriver.exe')
driver.get('https://www.upwork.com/ab/account-security/login')
driver.maximize_window()
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from bs4 import BeautifulSoup
import time
import pandas as pd
driver = webdriver.Chrome('/Users/patrickharris/Desktop/chromedriver/chromedriver.exe')
driver.get('https://www.upwork.com/ab/account-security/login')
driver.maximize_window()
from bs4 import BeautifulSoup
import pandas as pd
html_string = '''
<html>
<head>
<title>Classes</title>
<body>
<table>
<tr>
#set variables
a = 0
b = 1
start_at = 0
stop_at = 1001
#Set the program logic. While 0 < 100, execute the indented code below
# Instructs the computer to begin counting - iterating from start_at (0) and sets each digit as sum of the two preceding numbers
start_at = start_at + 1
old_a = a
@RootPat
RootPat / Linkpuller
Last active November 11, 2017 02:27
Grabs links off a given URL
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from bs4 import BeautifulSoup
driver = webdriver.Chrome('PATH_TO_CHROMEDRIVER')
driver.get('URL_to_scrape')
driver.maximize_window()
linkpuller = driver.find_elements_by_xpath('//a[@href]')
for elem in linkpuller:
@RootPat
RootPat / TCP Client
Created December 15, 2017 16:52
TCP client in Python
import socket
target_host=''
target_port=''
client = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
client.connect(target_host, target_port)
client.send("GET / HTTP/1.1\r\nHost; google.com\r\n\r\n")
response = clinet.recv(4096)
print(response)
import socket
target_host=''
target_port=''
client = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
client.sendto("Recon my dudes",(target_host, target_port))
data, addr = client.recvfrom(4096)
print(data)
import socket
import threading
bind_ip = '127.0.0.1'
bind_port='80'
server=socket.socket(socket.AF_INET, socket.SOCK_STREAM)
server.bind(('127.0.0.1',80))
server.listen(5)
print("[*] Listening on %s:%d" % ('127.0.0.1', 80))
<h2><?php _e( 'Recent news from Some-Other Blog:', 'my-text-domain' ); ?></h2>
<?php // Get RSS Feed(s)
include_once( ABSPATH . WPINC . '/feed.php' );
// Get a SimplePie feed object from the specified feed source.
$rss = fetch_feed( 'http://pat.world/feed/' );
if ( ! is_wp_error( $rss ) ) : // Checks that the object is created correctly
@RootPat
RootPat / result_display.js
Created December 19, 2017 00:28
Display result of Javascript function in a div element using inline HTML
<script type="text/javascript">
function calc()
{
var total = 0;
var course = 0;
var nrOfLessons = 0;
var vat = 0;
course = Number(document.getElementById("course").value)
nrOfLessons = Number(document.getElementById("nrOfLessons").value)