Skip to content

Instantly share code, notes, and snippets.

@howdydoody123
howdydoody123 / remote_servo.ino
Last active June 7, 2018 07:45
Remote control servo with Particle Photon. Apache License, copyright 2015 Sean Beck
Servo serv;
int pos = 0;
void setup() {
serv.attach(D0);
Spark.function("setpos", setPos);
Spark.variable("getpos", &pos, INT);
}
void loop() {
import time
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
url = 'http://www.supremenewyork.com/shop/jackets/silk-bomber/navy'
driver = webdriver.Firefox()
driver.get(url)
add = driver.find_element_by_name('commit')
'''
Copyright 2016 Sean Beck
MIT license
A simple script that provides a function to send an email via Mailgun.
This requires obtaining an API key from Mailgun.
You must also supply the function with the domain name associated with your account.
Mailgun will generate one for you, so just use that if you do not have your own domain.
'''
import requests
'''
A small module for getting the prices of bitcoin and litecoin from https://preev.com
Works for both Python 2 and 3. Easily importable and requires only a simple call.
'''
try:
from urllib import urlopen
except ImportError:
# py 3
from urllib.request import urlopen
import json
"""
PoC for address verification via USPS API
Docs: https://www.usps.com/business/web-tools-apis/address-information-api.htm#_Toc487629493
"""
import argparse
from bs4 import BeautifulSoup
import requests
@howdydoody123
howdydoody123 / sqlite_to_json.py
Created December 8, 2020 22:05
Converts a sqlite database table to a JSON file
import json
import os
import sqlite3
import sys
def dict_factory(cursor, row):
d = {}
for idx, col in enumerate(cursor.description):
d[col[0]] = row[idx]