This file contains hidden or 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
from jdatetime import date as jd, GregorianToJalali, JalaliToGregorian | |
import khayyam, jdatetime | |
from khayyam import JalaliDate | |
from datetime import date | |
from timeit import timeit | |
print('khayyam.__version__:', khayyam.__version__) | |
print('jdatetime.__VERSION__:', jdatetime.__VERSION__) | |
print('Jalali to Gregorian:') |
This file contains hidden or 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
"""Download WorldScienceYou coarse videos. | |
Requirements: | |
* python 3.6+ | |
* pip install youtube-dl requests | |
* create a config.py file with USERNAME and PASSWORD variables. | |
Running the script: | |
Make sure the coarse number at the last line of the script is correct and | |
then run... |
This file contains hidden or 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
from timeit import timeit | |
name = 'common_case' | |
def f0(name): # 0.38833552993028425 | |
stripped_name = name.strip('_') | |
tail = stripped_name[1:] | |
return stripped_name[:1].islower() and tail.lower() != tail | |
def f1(name): # 0.5023811628120246 |
This file contains hidden or 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
from timeit import * | |
try_method = ''' | |
try: | |
d[1][2] | |
except KeyError: | |
pass | |
''' | |
get_method = 'd.get(1, {}).get(2, {})' | |
if_method = ''' |
This file contains hidden or 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
pip list -o --exclude-editable --format freeze | cut -d= -f1 | xargs -n1 pip install -U |
This file contains hidden or 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
"""A simple script to unignore all the ignored words in a specific course in memrise. | |
You need to provide USERNAME, PASSWORD, and COURSE_URL below. | |
""" | |
from selenium.webdriver import Chrome | |
USERNAME = '' | |
PASSWORD = '' | |
COURSE_URL = 'https://app.memrise.com/course/{number}/{name}/' |
This file contains hidden or 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 checked_revs = document.querySelectorAll('#pagehistory input[type=checkbox]:checked'); | |
var user_revs = {}; | |
var user, parent, date, revs; | |
checked_revs.forEach(function(check){ | |
parent = check.parentNode; | |
user = parent.querySelector('.mw-userlink').innerText; | |
date = new Date(parent.querySelector('.mw-changeslist-date').innerText); | |
rev = {"date": date, "parent": parent}; | |
revs = user_revs[user]; | |
if (!revs) { |
This file contains hidden or 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
# call this server using the following js command from the browser console: | |
# (await fetch('http://localhost:5000/', {method: "POST", body: '5'})).text() | |
# note: wsgiref is only good for development and in that case Werkzeug is | |
# usually preferred. See http://mitsuhiko.pocoo.org/wzdoc/wsgihowto.html | |
from wsgiref.simple_server import make_server | |
from flask import Flask, request, Response | |
app = Flask(__name__) |
We can make this file beautiful and searchable if this error is corrected: Unclosed quoted field in line 1.
This file contains hidden or 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
Intended Graduate Major,"VR 130- | |
134","VR 135- | |
139","VR 140- | |
144","VR 145- | |
149","VR 150- | |
154","VR 155- | |
159","VR 160- | |
164","VR 165- | |
169",VR 170,VR N,VR M,VR SD,"QR 130- | |
134","QR 135- |
This file contains hidden or 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
<!doctype html><html lang=en><head><meta charset=utf-8><meta http-equiv=cleartype content="on"><meta http-equiv=x-ua-compatible content="ie=edge"><meta name=viewport content="width=device-width,initial-scale=1"><meta name=HandheldFriendly content="True"><meta name=MobileOptimized content="320"><meta name=apple-itunes-app content="app-id=504631398, app-argument=https://www.usatoday.com/story/entertainment/movies/2019/11/12/star-wars-disney-plus-changes-controversial-han-solo-greedo-scene/2576097001/entertainment/movies"><meta content="#ffffff" name=theme-color><meta content="article" property="og:type"><meta property="article:content_tier" content="free"><meta property="article:opinion" content="false"><meta property="fb:pages" content="13652355666"><meta property="og:title" content="The infamous 'Han shot first' scene in 'Star Wars' has changed yet again on Disney+"><meta name=description content="\" did han shoot first?\" has been debated for years among \"star wars\" fans and the controversy is stoked again |
OlderNewer