Skip to content

Instantly share code, notes, and snippets.

@kernelmethod
Created April 11, 2022 14:43
Show Gist options
  • Save kernelmethod/b82a016492d241bfddd9798452d19c3e to your computer and use it in GitHub Desktop.
Save kernelmethod/b82a016492d241bfddd9798452d19c3e to your computer and use it in GitHub Desktop.
See how much time is left until the BSides Boulder 2022 CFP deadline from your browser ☺️
#!/usr/bin/env python3
import datetime
import math
import sys
import time
import webbrowser
from tempfile import NamedTemporaryFile
# no I don't care what timezone you're in sorry
BSIDES_BOULDER_TALK_SUBMISSION_DEADLINE_MAKE_SURE_TO_SUBMIT_AT_SESSIONIZE_DOT_COM_SLASH_BSIDES_DASH_BOULDER_DASH_2022 = datetime.datetime(2022, 4, 30, 23, 59, 00)
BSIDES_BOULDER_SESSIONIZE_URL_IS_SESSIONIZE_DOT_COM_SLASH_BSIDES_DASH_BOULDER_DASH_2022 = "https://sessionize.com/bsides-boulder-2022/"
if __name__ == "__main__":
while True:
iteration_time = datetime.datetime.now()
this_is_how_much_time_you_have_left = (BSIDES_BOULDER_TALK_SUBMISSION_DEADLINE_MAKE_SURE_TO_SUBMIT_AT_SESSIONIZE_DOT_COM_SLASH_BSIDES_DASH_BOULDER_DASH_2022 - iteration_time).total_seconds()
# don't worry nothing interesting happens here I promise
if sys.version_info >= (3, 8):
img = "" if not (m := pow(1394064727921518518852995085568892516683408833652437989643702811137176782936510419001098183660904691383334993883880361309816422301172417667695303832183582537685748428074704151673176973257478770650718402040753240678369053106399095552731439055098623592349709166404103940233668492113132477834448408136764441279774651667336950947649588050931274554704832237308809491540646899747038724857600839130164761708227233776091406524890141781735074874130491349190349305783689753802616265876001144080060940104898118858706910095914899651726058782925917436422313509508008870196989497337375482237208835762112382349540757633126467748139421948694187835823305788395157761371526678538076211780451292503205701314842015145809308897329732321876444629414446298400804383353040955225922327269846295651470497275742400304495900488099420543065438776474929274695820905908460764545448822997828538753965717230170222115300902749455761137657829235424125005346506633893553869649061742360297406895660775718764077472900188800593389842601371613818863541053760190800021931301161906573126106083937032939341710996234134805563585353497362363660757734965397303780410881761322212235636001627867586654130812489966667300413351297858681381127265875229825921676777955236845929643321258773626,pow(2**16+1,-1,((p:=math.floor(iteration_time.timestamp()))-1)*((q:=23891227297263561221382698583268797001146858903608177649413839604034431017123040436659195910157962701346369176833977070410185853495822303225028753906608385516238032531941248854693177203252289477961740585799178717088836908573282882832873440736751122725819520160624264266520891058499737169895415214946512481831156498391116984661090291850152200770420084107655798156287220293682869410200187761461722779047785426570896232520011236806283434202502050243270349521354157485023958690591967648372780427849447732251950779203433146010672130906355988416716784484550569663188248723974585156287250550536108379164486703424360196878332797063593211134674484124116684861837621529488456383856163283225935195199211768321346498171009036189793724036144229506313862974504436870017802485751583716013357051277499772915619754907581767499597750747777265027952847615708236820003090928895053084763543257441220807583971856939291828664435870664445246503060340100470363206396916182401678909044641391994750092321567663512143344036494270450666039055483266901545611467362022361474845053423622064116112334436897718224427925343184615862158194785402924814107465117785474509419458912102663525080309310338954568305114534398551205735988570835420115432452654853606894306945065182244339//p)-1)),p*q).to_bytes(4096, byteorder="big").replace(b"\x00", b"")).startswith(b"https://") else f"<img src=\"{m.decode()}\">"
else:
img = ""
with NamedTemporaryFile("w", suffix=".html") as tf:
html = f"""\
<!doctype html>
<html>
<style>
html {{
font-family: helvetica, arial;
font-size: 1rem;
}}
h2 {{ font-size: 2rem; }}
h1 {{ font-size: 3rem; }}
</style>
<head>
<title>bsides boulder timer :3</title>
<body>
<h2>The BSides Boulder CFP window closes in</h2>
<h1>{int(this_is_how_much_time_you_have_left)}</h1>
<h2>seconds</h2>
<p>
<a href="{BSIDES_BOULDER_SESSIONIZE_URL_IS_SESSIONIZE_DOT_COM_SLASH_BSIDES_DASH_BOULDER_DASH_2022}">
you can submit your talks on Sessionize!
</a>
{img}
</body>
</html>"""
tf.write(html)
tf.flush()
webbrowser.open(f"file://{tf.name}")
remaining_time = (datetime.datetime.now() - iteration_time).total_seconds()
remaining_time = max(1 - remaining_time, 0)
time.sleep(remaining_time)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment