Skip to content

Instantly share code, notes, and snippets.

@emwdx
emwdx / earthmoonsim.py
Created November 13, 2012 10:28
Earth-Moon orbit simulator
from math import *
#All distance units are in m, velocity in m/s
#Enter initial simulation data here
initial_x = -6.38E6
initial_y = 12E6
initial_vx = 1.1E4 #-6.38E6,12E6,1.1E4,3.5E3
@emwdx
emwdx / gravitysim.py
Created November 13, 2012 10:37
One dimensional simulation of a falling object
#One dimensional gravity simulation.
#Programmed by Evan Weinberg
#v0.1 - Initial program
initial_height = 30 #meters
initial_velocity = 10 #m/s
mass = 1 #kilogram
g = 9.81 #m/s^2
is_ground = True #Set this to True if you want to simulate the ground.
@emwdx
emwdx / pidigits.py
Last active December 14, 2015 18:18
My tool for memorizing digits of pi in five digit chunks.
pi = '3.1415926535897932384626433832795028841971693993751058209749445923078164\
062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303820'
index = 2
for i in range(10):
print "\n"
14159
@emwdx
emwdx / IB Exam Language Analysis
Created December 18, 2014 10:08
This was the program I used to analyze the language through seven IB Physics exams and identify the most common words.
import string
common = ['the','be','to','of','and','a','in','that','have','I','it','for','not','on','with','he','as','you','do','at','this','but','his','by','from','they','we','say','her','she','or','an','will','my','one','all','would','there','their','what','so','up','out','if','about','who','get','which','go','me','when','make','can','like','time','no','just','him','know','take','people','into','year','your','good','some','could','them','see','other','than','then','now','look','only','come','its','over','think','also','back','after','use','two','how','our','work','first','well','way','even','new','want','because','any','these','give','day','most','us']
additionalCommon = ['is','question','part','are','continued','candidates•','answer','answers','provided•','so•','examination','continues','continuesd','m134physisp2engtz1xxquestion','baccalaureate','minutesinstructions','pagewill','international','reference','booklet','continuedd','instructed','continuedpart','questions','paper•','continuedc','m134physisp2
from random import *
from math import *
g= 9.8
y0 = 1.9
horizontalDistance = 20.0
hoopHeight = 3.05
startingV = 10
startingT = 30
class Projectile():
@emwdx
emwdx / ps-data-export.js
Created November 9, 2016 01:18
Export data from Powerschool Pro from the console
var nameElements = $('.student-name').toArray();
var assignmentElements = $('var').toArray();
var names = [];
var assignments = [];
var assignmentNumber;
assignmentElements.forEach(function(name,index){
assignments.push(name.innerHTML)
@emwdx
emwdx / appt-finder.js
Created February 27, 2021 11:17
quick way to find rite aid locations with vaccines in NE Ohio
//Put the store numbers for stores near you in this list
var nearbyStores = [3041,3163,7939,3131,3043,3011,2665,2654,4071,2640,3157,2665,3486]
var dataURLs = [];
var responseURLS = [];
var response;
for(var i = 0;i<nearbyStores.length;i++){
var dataURL = "https://www.riteaid.com/services/ext/v2/vaccine/checkSlots?storeNumber=" + nearbyStores[i];
dataURLs.push(dataURL)
@emwdx
emwdx / ooo_autoreply.js
Last active August 9, 2021 08:25
Out of Office Autoreply - Google Scripts
// Out of Office Autoreply - Google Script code by Evan Weinberg (Twitter: @emwdx)
// This code was based on the code for the google script autoreply post here on stack overflow: https://stackoverflow.com/questions/38955161/google-gmail-script-time-auto-reply
function autoReply() {
var interval = 5; // Set to the number of minutes between runs of this script. You set this also in the trigger settings through the stop-watch tab.
var daysOff = [0,6]
var weekdayMessageDays = [1, 2, 3, 4, 5] // 1=Mo, 2=Tu, 3=We, 4=Th, 5=Fr, 6=Sa, 0=Su
var workingHours = [8,17]; // 0-24
@emwdx
emwdx / ooo_autoreply_modular.js
Created August 22, 2021 08:04
ooo_autoreply_modular
// Out of Office Autoreply - Google Script code by Evan Weinberg (Twitter: @emwdx)
// This code was based on the code for the google script autoreply post here on stack overflow: https://stackoverflow.com/questions/38955161/google-gmail-script-time-auto-reply
// Define the variables we want to be available over our entire program here:
var interval;
var daysOff;
var weekdayMessageDays;
var workingHours;
function setGlobalVariables(){
@emwdx
emwdx / gist:6feca7daf3628c74af6b76cc8aff5efb
Last active January 5, 2022 14:59
FX_Hash Verification
I am attesting that this GitHub handle Emwdx is linked to the Tezos account tz2MzmeTaiFwo1nAX9XeZi9XVFXhjPUZ5oZx for tzprofiles
sig:spsig18EMkDznNBBmN5ZZi3YEF8rrwbNAibKnHiJLXzn4V76XzSccG82m1beEbvKPdMLERNVV9Pn1H8K4N4RrqWQhVzTVqdgX7Y