Skip to content

Instantly share code, notes, and snippets.

View shaungt1's full-sized avatar
🎯
Focusing

Shaun Pritchard shaungt1

🎯
Focusing
View GitHub Profile
@shaungt1
shaungt1 / goldbach_recursion.js
Created April 27, 2018 04:44 — forked from ihercowitz/goldbach_recursion.js
Goldbach's conjecture in JavaScript - using Recursion
/* Goldbach's conjecture in JavaScript - using Recursion
*
* author: Igor Hercowitz
*/
function isPrime(n) {
if (n % 2 === 0) return false;
var sqrtn = Math.sqrt(n)+1;
@shaungt1
shaungt1 / circle_detection.py
Created December 4, 2018 00:29 — forked from martinsik/circle_detection.py
Circle detection with OpenCV 3.0
import cv2
import time
import math
import numpy as np
capture = cv2.VideoCapture(0)
print capture.get(cv2.CAP_PROP_FPS)
t = 100
w = 640.0
br = webdriver.Firefox() #open firefox
br.get('https://www.allrecipes.com/recipes/'+str(yearurls[i]))
###ID number for year, example 1997 has ID of 14486
html_list = br.find_element_by_id("grid")
urls = html_list.find_elements(By.CLASS_NAME, "favorite")
#All top 20 recipes have hearts associated with them. Inside
#the heart contains the unique ID number for the given recipe
for i, e in enumerate(urls):
def scrape_recipe(br, year, idnumber):
#This is called when user wants to scrape for specific recipe site
#Try functions were used to prevent any one element from stopping the operation
#recipe title
try:
rtitle = br.find_element_by_tag_name('h1').text
except:
rtitle = 'NA'
@shaungt1
shaungt1 / AutoConnectLinkedIn.js
Created May 14, 2021 18:05 — forked from thealphadollar/AutoConnectLinkedIn.js
JS script to send connection requests to your LinkedIn search results with customisation options, accept all received connection requests, and withdraw pending sent connection requests.
// If the script does not work, you may need to allow same site scripting https://stackoverflow.com/a/50902950
Linkedin = {
config: {
scrollDelay: 3000,
actionDelay: 5000,
nextPageDelay: 5000,
// set to -1 for no limit
maxRequests: -1,
totalRequestsSent: 0,
@shaungt1
shaungt1 / AutoConnectLinkedIn.js
Created May 14, 2021 18:05 — forked from thealphadollar/AutoConnectLinkedIn.js
JS script to send connection requests to your LinkedIn search results with customisation options, accept all received connection requests, and withdraw pending sent connection requests.
// If the script does not work, you may need to allow same site scripting https://stackoverflow.com/a/50902950
Linkedin = {
config: {
scrollDelay: 3000,
actionDelay: 5000,
nextPageDelay: 5000,
// set to -1 for no limit
maxRequests: -1,
totalRequestsSent: 0,