Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View sojohnnysaid's full-sized avatar
💾

John James sojohnnysaid

💾
View GitHub Profile
@sojohnnysaid
sojohnnysaid / index.html
Created March 17, 2024 05:54
Animation reciting a quote from Pico Iyer
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Quote Animation</title>
<script src="https://cdn.jsdelivr.net/npm/vue@2.6.14/dist/vue.js"></script>
<style>
body {
margin: 0;
@sojohnnysaid
sojohnnysaid / python_file_IO_1.py
Created November 3, 2019 22:52
File IO in python
import csv
from cs50 import get_string
from student import Student
# Space for students
students = []
# Prompt for students' names and dorms
for i in range(3):
name = get_string("name: ")
@sojohnnysaid
sojohnnysaid / apology.html
Created January 2, 2020 12:52
CS50 Finance app
{% extends "layout.html" %}
{% block title %}
Apology
{% endblock %}
{% block main %}
<img alt="{{ top }}" class="border" src="http://memegen.link/custom/{{ top | urlencode }}/{{ bottom | urlencode }}.jpg?alt=https://i.imgur.com/CsCgN7Ll.png"/>
{% endblock %}
@sojohnnysaid
sojohnnysaid / encode_decode.py
Last active January 19, 2021 22:58
encoding/decoding data in python using the cryptography, dotenv libraries
import os
import json
import time
from dotenv import load_dotenv
from cryptography.fernet import Fernet
load_dotenv()
timestamp = time.time()
my_secret_key = str.encode(os.getenv('email_confirmation_secret_key'))
crypto = Fernet(my_secret_key)
;; CMPU 101 Assignment 3
;; <YOUR NAME>
;;
;; Description: Uses a list of bouncing balls to animate many balls
;; of different sizes and colors, all moving in the same scene at
;; different speeds.
(require 2htdp/image)
(require 2htdp/universe)
@sojohnnysaid
sojohnnysaid / HtDF_example1.rkt
Created May 8, 2020 10:10
Simple Data Course section 1b - HtDF example
;; Signature
;; String -> String
;; Purpose
;; adds "!" to the end of s
;; Examples
(check-expect (yell "hello") "hello!") ; elborate - "hello" + "!"
(check-expect (yell "goodbye") "goodbye!") ; elborate - string-append "goodbye" "!"
@sojohnnysaid
sojohnnysaid / problem_sets.rkt
Last active January 19, 2021 22:58
How to code simple data 1a: Beginning Student Language - my problem set solutions
;;---------------------------
;; arithmetic expression
;;---------------------------
(* 3 5 7)
(* (* 3 5) 7)
;;---------------------------
@sojohnnysaid
sojohnnysaid / email_monthly_coach_stats.gs
Created January 18, 2020 15:53
get dotafromzero coach stats via email
function email_Monthly_Coach_Stats() {
// get the current sheet as a 2d array
sheetData = getSheetData();
// filter the data by current month
sheetData = filterByCurrentMonth(sheetData);
// process the sheet and get back a nicely formatted object for emailing
sheetData = processData(sheetData);
@sojohnnysaid
sojohnnysaid / models.py
Created December 29, 2019 00:24
models file I created for the CS50 finance project
from cs50 import SQL
import sqlite3
class users_db:
def __init__(self, conn):
self.id = ''
self.conn = conn
self.c = conn.cursor()
def register(self, username, hash):
@sojohnnysaid
sojohnnysaid / application.py
Created November 29, 2019 13:36
flask app using sessions and the flask session extension
from flask import Flask, redirect, render_template, request, session
from flask_session import Session
# Configure app
app = Flask(__name__)
# Configure sessions
app.config["SESSION_PERMANENT"] = False
app.config["SESSION_TYPE"] = "filesystem"
Session(app)