Skip to content

Instantly share code, notes, and snippets.

View BlakeStevenson's full-sized avatar

Blake Stevenson BlakeStevenson

View GitHub Profile
@BlakeStevenson
BlakeStevenson / EventList.txt
Last active December 15, 2020 02:09
USTA PlayTennis GraphQL API
https://prod-us-kube.clubspark.io/usta/tournaments/api/graphql
query {
publishedEvents(
tournamentId: "0595eb49-a55f-4de2-8919-caeff6d21fbe"
previewMode: false
) {
id
courtLocation
level {
@BlakeStevenson
BlakeStevenson / texas-dps.js
Last active February 17, 2023 09:18
Create a Texas DPS appointment at the closest office & soonest time.
const axios = require('axios');
async function getLocations() {
const locationsData = await axios.post("https://publicapi.txdpsscheduler.com/api/AvailableLocation", {
"TypeId": 71,
"ZipCode": "75028",
"CityName": "",
"PreferredDay": 0
});
return locationsData.data;
}
@BlakeStevenson
BlakeStevenson / texas-dps.js
Last active March 24, 2024 01:20
Create an appointment at the Texas DPS at the closest location, soonest time, programatically.
const axios = require('axios');
async function getLocations() {
const locationsData = await axios.post("https://publicapi.txdpsscheduler.com/api/AvailableLocation", {
"TypeId": 71,
"ZipCode": "10001",
"CityName": "",
"PreferredDay": 0
});
return locationsData.data;
}
@BlakeStevenson
BlakeStevenson / calendar.php
Last active December 1, 2019 17:06
Notion Database to Calendar
<?php
header('Content-Type: text/calendar; charset=utf-8');
header('Content-Disposition: attachment; filename="cal.ics"');
date_default_timezone_set('America/Chicago');
require_once './vendor/autoload.php';
// calendar name
$vCalendar = new \Eluceo\iCal\Component\Calendar('Tennis Tournaments');
// get database entries from python script
$events = json_decode(shell_exec("python3 notion.py"), true);
function updateName() {
uuid = document.getElementById("uuid").value;
fetch('https://api.mojang.com/user/profiles/' + uuid + '/names', {
method: 'GET',
mode: 'no-cors'
})
.then(response => response.json())
.then(result => alert(JSON.stringify(result)))
});
}
function updateNether() {
var netherX = document.getElementById("nether-x");
var netherZ = document.getElementById("nether-z");
var overworldX = document.getElementById("overworld-x");
var overworldZ = document.getElementById("overworld-z");
netherX.value = Math.round((overworldX.value / 8));
netherZ.value = Math.round((overworldZ.value / 8));
}
function updateOverworld() {
var netherX = document.getElementById("nether-x");
<?php
function school_roster($id) {
$url = "https://www.myutr.com/api/v1/club/$id/school";
// Initialize a CURL session.
$ch = curl_init();
// Return Page contents.
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
<?php
session_start();
// allow error reporting
ini_set('display_errors', true);
// check if parameters are set properly
if(isset($_POST['subdomain']) && isset($_POST['port']) && isset($_POST['target']) && isset($_POST['g-recaptcha-response'])) {
// include Cloudflare & reCaptcha API Libraries
require_once "/var/www/shulker/vendor/autoload.php";
<?php
// set JSON header
header('Content-Type: application/json');
// check for version
if($_SERVER['REQUEST_URI'] === "/v1") {
// select endpoint
switch($_SERVER['REQUEST_URI']) {
case "v1/user":
require_once "endpoints/user.php";
break;