Skip to content

Instantly share code, notes, and snippets.

View mojowen's full-sized avatar
🍕
🤔

Scott Duncombe mojowen

🍕
🤔
View GitHub Profile
import json
import os
from datetime import datetime, timedelta, timezone
from dateutil import parser
from urllib.parse import quote
import time
import requests
APIKEY = os.getenv("GITLAB_APIKEY", "")
@mojowen
mojowen / getActors.js
Last active March 18, 2021 18:37
Make a list of actors from a given list of moves in themoviedb.org
// HOW TO USE
// 1. Visit https://api.themoviedb.org/what in your browser
// 2. Open your javascript console
// 3. Update the two constants below
// 4. Paste into the console
const API_KEY = "ADD-YOUR-API-KEY"
const LIST_ID = "ADD-LIST-ID"
const { items } = await (await fetch(`https://api.themoviedb.org/3/list/${LIST_ID}?api_key=${API_KEY}`)).json()
@mojowen
mojowen / pizzaHut.js
Created September 16, 2020 22:14
Figure out if pizza hut serves a given address
const fetch = require('node-fetch')
const PIZZA_HUT_ENDPOINT = 'https://www.pizzahut.com/api.php/site/api_ajax/search/delivery'
const getCookies = async() => {
const resp = await fetch(PIZZA_HUT_ENDPOINT, { method: 'post' })
return resp.headers.get('set-cookie').split(',').map((el) => (`${el.split(';')[0]}`)).join(';')
}
{
"AL": "https://www.workelections.com/states/1/Alabama",
"AK": "https://www.workelections.com/states/2/Alaska",
"AZ": "https://www.workelections.com/states/4/Arizona",
"AR": "https://www.workelections.com/states/5/Arkansas",
"CA": "https://www.workelections.com/states/6/California",
"CO": "https://www.workelections.com/states/8/Colorado",
"CT": "https://www.workelections.com/states/9/Connecticut",
"DE": "https://www.workelections.com/states/10/Delaware",
"DC": "https://www.workelections.com/states/11/DistrictofColumbia",
@mojowen
mojowen / experiment.html
Last active July 15, 2020 03:16
NVRD Experiment iframe
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/iframe-resizer/3.5.3/iframeResizer.min.js"></script>
<iframe width="70%" height="1350" id="iframe1" src="" scrolling="no" style="overflow: hidden; height: 1350px;"></iframe>
<script>
function getUrlVars() {
var vars = {};
var parts = window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi, function (
m,
key,
@mojowen
mojowen / check_if_address_is_polling_place.py
Last active September 13, 2018 18:49
Pizza to the Polls Zap Code Steps
"""
input_data = {
"api_key": "some-api-key",
"zip": "11235", #
"state": "NY", # State of polling place
"street": "510 Claremont Ave", # Address of Polling Place
"vicinities": "address1,address2,address3", # Comma separated list of vicinities returbed from Google Places query
}
Example Google Places Query:
export ME_EMOJI=(🍕 🔥 💪 ⛷ 🤷 🤞 🤔 🤠 👩‍🎤 👾 👻 🌊 🚀 👉 🗿 🦅 👩🏿‍🚀 ☠ 😑 👀 👩🏻‍🔬 ⚡️ ☃️ 🌪 💨 🌮 🍺 🥃 🏊🏻‍♀️ 🏋🏽‍♀️ ⛺️ 🌋 🏔 🌁 🏞 💣)
RANDOM_ME_EMOJI=${ME_EMOJI[$((RANDOM%${#ME_EMOJI[@]}))]};
export PS1="${RANDOM_ME_EMOJI} \w $ "
export ME_EMOJI=(🍕 🔥 💪 ⛷ 🤷 🤞 🤔 🤠 👩‍🎤 👾 👻 🌊 🚀 👉 🗿 🦅 👩🏿‍🚀 ☠ 😑 👀 👩🏻‍🔬 ⚡️ ☃️ 🌪 💨 🌮 🍺 🥃 🏊🏻‍♀️ 🏋🏽‍♀️ ⛺️ 🌋 🏔 🌁 🏞 💣)
RANDOM_ME_EMOJI=${ME_EMOJI[$((RANDOM%${#ME_EMOJI[@]}))]};
export PS1="${RANDOM_ME_EMOJI} \w $ "
Verifying my Blockstack ID is secured with the address 1WaLst1EWmDVQfZXRidrHyJf8WtQcSzAG https://explorer.blockstack.org/address/1WaLst1EWmDVQfZXRidrHyJf8WtQcSzAG
@mojowen
mojowen / index.html
Last active November 7, 2016 05:11
Fullpage JustVote
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?sensor=true&libraries=geometry"></script>
<script src="http://justvotecolorado.org/justvote/js/electionMap.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js"></script>
<script type="text/javascript">
ElectionMap.prototype.config = {"types":{"drop off":{"long_title":"drop off","icon":"http://chart.apis.google.com\/chart?chst=d_map_pin_letter&chld=|00bdef"},"vote center":{"long_title":"vote center","icon":"http://chart.apis.google.com\/chart?chst=d_map_pin_letter&chld=|ff4429","default":"true"}},"states":["on","on"],"url":"https:\/\/spreadsheets.google.com\/feeds\/list\/1jCTNodsee2a36JrZaQ-QY0t4VN24cwP3VFi3gG77ixA\/ovnuykr\/public\/values"}
</script>
</head>