Skip to content

Instantly share code, notes, and snippets.

View pamelafox's full-sized avatar

Pamela Fox pamelafox

View GitHub Profile
@pamelafox
pamelafox / countries_and_territories.sql
Last active May 2, 2024 20:09
countries_and_territories.sql
/*
Countries and dependent territories, 2020
Data adapted from
http://www.worldometers.info/world-population/population-by-country/
Does not include rows which had "N.A." values, so some territories are missing.
*/
CREATE TABLE countries(
name TEXT PRIMARY KEY,
population INTEGER,
// Includes functions for exporting active sheet or all sheets as JSON object (also Python object syntax compatible).
// Tweak the makePrettyJSON_ function to customize what kind of JSON to export.
var FORMAT_ONELINE = 'One-line';
var FORMAT_MULTILINE = 'Multi-line';
var FORMAT_PRETTY = 'Pretty';
var LANGUAGE_JS = 'JavaScript';
var LANGUAGE_PYTHON = 'Python';
@pamelafox
pamelafox / pokemon.sql
Created March 20, 2020 16:51
Pokemon statistics
CREATE TABLE pokemon(
Number INTEGER,
Name TEXT PRIMARY KEY,
Type_1 TEXT,
Type_2 TEXT,
Total INTEGER,
HP INTEGER,
Attack INTEGER,
Defense INTEGER,
Sp_Atk INTEGER,
@pamelafox
pamelafox / screenshot.js
Created April 10, 2015 07:24
Screenshot Bookmarklet
// How to add a bookmarklet to Chrome: https://www.google.com/webhp?sourceid=chrome-instant&ion=1&espv=2&ie=UTF-8#q=chrome%20bookmarklet
javascript:(function getScreenshot() {var openScreenshot = function(e) {window.open(e.originalEvent.data);}; $(window).unbind("message.getScreenshot", openScreenshot); $(window).bind("message.getScreenshot", openScreenshot); ScratchpadUI.liveEditor.postFrame({ screenshot: true, screenshotSize: 400 });})();
@pamelafox
pamelafox / astronauts.sql
Created March 20, 2020 18:24
NASA astronauts, 1959-Present
/* Source:
https://www.kaggle.com/nasa/astronaut-yearbook
*/
CREATE TABLE astronauts(
Name TEXT PRIMARY KEY,
Year INTEGER,
GroupNum INTEGER,
Status TEXT,
Birth_Date TEXT,
Birth_Place TEXT,
@pamelafox
pamelafox / chatreadretrieveread.py
Created November 7, 2023 20:21
Chat approach with additional function call
import json
import logging
import re
from typing import Any, AsyncGenerator, Optional, Union
import aiohttp
import openai
from azure.search.documents.aio import SearchClient
from azure.search.documents.models import QueryType
@pamelafox
pamelafox / links.md
Created April 4, 2024 23:34
Links for PyCascades
@pamelafox
pamelafox / nfl_picks.sql
Last active April 4, 2024 07:05
nfl_picks.sql
/*
1st 3 rounds of the NFL 2015 Draft
Collected by: https://www.khanacademy.org/profile/BobbyandKaren/
*/
CREATE TABLE picks(
id INTEGER PRIMARY KEY,
pick_number INTEGER,
name TEXT,
college TEXT,
@pamelafox
pamelafox / card_games_results.sql
Created May 8, 2015 19:19
card_games_results.sql
/* Friendly Card Game Results:
During this past winter, a few friends got together every Wednesday night for a friendly game of cards. On some nights they'd play two games, but never the same game twice on the same night. The usual players were Spunky Sam, Marcimus, Winston, and Hopper. Sometimes, one of the friends couldn't make it, so there were only three players. But sometimes they'd call another friend to fill-in. In every game they played, the one with the hightest score was declared the winner. These are their results:
Created by: https://www.khanacademy.org/profile/brianduckworth
*/
CREATE TABLE card_games(id INTEGER PRIMARY KEY AUTOINCREMENT,
date_played TEXT,
game_name TEXT,
player_name TEXT,
score INTEGER);
@pamelafox
pamelafox / winstons_donut_logs.sql
Last active April 4, 2024 06:58
winstons_donut_logs.sql
/*
Winston's Donut logs
This table of logs shows how many donuts Winston eats at each year of his life,
plus any particular reason to explain his eating habits.
Collected by: https://www.khanacademy.org/profile/mhogwarts/
*/
CREATE TABLE winstons_donut_logs (
id TEXT PRIMARY KEY,
status TEXT,
years_old INTEGER,