Skip to content

Instantly share code, notes, and snippets.

@Celeo
Celeo / vatsim_dev_oauth.py
Created September 16, 2023 19:07
Extremely simple Python Flask app for authenticating with VATSIM Dev OAuth
import json
from urllib.parse import quote_plus
from flask import Flask, redirect, request, jsonify
import httpx
app = Flask(__name__)
CLIENT_ID = '638'
@Celeo
Celeo / script.js
Created August 29, 2018 00:19
Block posts and comments from Tildes users
// ==UserScript==
// @name Block Tildes user comments
// @version 0.1
// @description Block Tildes comments
// @author github.com/Celeo
// @match https://tildes.net/*
// @grant none
// @require http://code.jquery.com/jquery-latest.js
// ==/UserScript==
<?xml version="1.0"?>
<Facility xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" ID="KSMO" Name="Santa Monica" UpdatedOn="2020-09-17T12:30:00.0000000-07:00">
<Frequency>133475</Frequency>
<VoiceServer>vhf.laartcc.org</VoiceServer>
<InformationDisplaySystemEndpoint>https://ids.laartcc.org/remote/atis</InformationDisplaySystemEndpoint>
<MetarObservation ObservationTimeValue="53" Enable="true" />
<MagneticVariation MagneticVariationValue="10" Option="Subtract" />
<Contractions />
<Profiles>
<Profile Name="Normal (24L/R)">
@Celeo
Celeo / README.md
Last active September 18, 2022 23:19

Run via deno run --allow-net zla_membership_data.ts.

Take the results and put them into Excel / Google Sheets / etc.

const STATUS_ENDPOINT = "https://status.vatsim.net/status.json";
export interface FlightPlan {
flight_rules: string;
aircraft: string;
aircraft_faa: string;
aircraft_short: string;
departure: string;
arrival: string;
alternate: string;
import { parse, HTMLElement } from "https://esm.sh/node-html-parser@5.3.3";
/**
* A single connection's information.
*/
export interface ConnectionItem {
id: number;
vatsim_id: string;
type: number;
rating: number;
@Celeo
Celeo / App.js
Last active March 22, 2020 02:27
Simple example of using pullstate
import React from 'react'
import { useStoreState } from "pullstate"
import { UIStore } from "./store"
function App() {
const name = useStoreState(UIStore, s => s.name)
const onChange = (event) => {
const newVal = event.target.value
UIStore.update(s => {
@Celeo
Celeo / get_scopes.py
Created April 27, 2018 00:04
Preston: scope(s) for operationId
def print_scopes_for_op_id(preston, op_id):
path = p._get_path_for_op_id(op_id)
print(f'Path for operationId "{op_id}" is "{path}"')
path_spec = p._get_spec()['paths'][path]
for key in path_spec:
if path_spec[key].get('security'):
print(f'"{path} :: {key}" requires scopes: ' + ', '.join(path_spec[key]['security'][0]['evesso']))
op_id = 'get_characters_character_id_stats'
import sqlite3
from preston.xmlapi import Preston
connection = sqlite3.connect('data.db')
cursor = connection.cursor()
cursor.execute('SELECT character_name FROM member')
character_names = [e[0] for e in cursor.fetchall()]
@Celeo
Celeo / ecm_calculations.html
Last active October 2, 2016 00:09
EVE Online ECM chance calculations
<!DOCTYPE html>
<title>ECM Calculations</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.0.1/vue.js"></script>
<link href="http://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.97.7/css/materialize.min.css">
<script src="https://code.jquery.com/jquery-3.1.1.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.97.7/js/materialize.min.js"></script>
<body class="grey lighten-2">
<br><br><br><br>
<div class="container">