This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Based off of https://github.com/ArnaudValensi/ArnaudValensi.github.io/blob/master/bin/get-blog-posts.py | |
# See https://erc.sh/blog/notion-cms for details | |
from notion.client import NotionClient | |
from PIL import Image, ExifTags | |
import os | |
import pytz | |
import requests | |
import hashlib | |
import shutil |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getPercentageFromA(a) { return parseInt(($(a.getAttribute('data-content')).find('div')[0].innerHTML).split('%')[0]); } | |
function getAveragePercentage() { | |
var total = 0; | |
var count = 0; | |
for (var a of $('.lattice-single-character ul li a')) { | |
var percentage = getPercentageFromA(a); | |
if (!isNaN(percentage)) { | |
total += percentage; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import csv | |
class Trans: | |
def __init__(self, item, receiver, giver, amount): | |
self.item = item | |
self.receiver = receiver | |
self.giver = giver | |
self.amount = amount | |
people = ["eric", "adam", "mike", "shan", "chris"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
hws = [0, 0, 0, 0, 0, 0] | |
mid1 = 0 | |
mid2 = 0 | |
def calcFinalNeeded(target, hws, mid1, mid2): | |
hw_avg = sum(hws) / 290 * .2 * 100 | |
target_exam_avg = target - hw_avg | |
method1_grade = (target_exam_avg - 20*mid1/150 - 20*mid2/150)/40*100 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import csv | |
CONVERSION_RATE = 117.3 | |
class Trans: | |
def __init__(self, item, receiver, giver, amount): | |
self.item = item | |
self.receiver = receiver | |
self.giver = giver | |
self.amount = amount |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var primeCount = 0; | |
for(var i = 2 ;; i++) { | |
var isPrime = true; | |
for(var j = 2; j < i; j++) { | |
if(i % j == 0) { | |
isPrime = false; | |
break; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import random, time | |
RUNS_PER_DECK = 1000000 #million | |
def generateDeck(numDoubles): | |
""" Generate a random array of 30 numbers representing unique cards """ | |
numUnique = 30 - (numDoubles*2) - 1 | |
deck = [0] |