Skip to content

Instantly share code, notes, and snippets.

View zhudotexe's full-sized avatar

Andrew Zhu zhudotexe

View GitHub Profile
import base64
import hashlib
import struct
import hmac
# encode
# https://docs.python.org/3/library/struct.html
STRUCT_FORMAT = '!QQQB'
packed = struct.pack(STRUCT_FORMAT, MESSAGE_ID, CHANNEL_ID, AUTHOR_ID, SCOPE)
print(packed)
import inspect
def show_sig(thing, scope):
print(f"{scope}: {inspect.signature(thing)} - {inspect.ismethod(thing)=}")
def deco_show_sig(func):
show_sig(func, 'decorator')
return func
import re
import timeit
def find_inline_exprs(content, context_before=5, context_after=2, max_context_len=128):
"""Returns an iterator of tuples (expr, context_before, context_after)."""
content_len = len(content)
# all content indexes
idxs = []
import time
from MeteorClient import MeteorClient
UNAME = input("un: ")
PWD = input("pwd: ").encode()
client = MeteorClient('wss://dicecloud.com/websocket', debug=True)
client.connect()
print("Connected")
import os
import requests
WORD_CACHE = {}
API_KEY = os.environ.get("API_KEY")
API_BASE = f"https://dictionaryapi.com/api/v3/references/collegiate/json/{{}}?key={API_KEY}"
def get_ipa(word):
__________________________________________________________________________________________________
Layer (type) Output Shape Param # Connected to
==================================================================================================
h (InputLayer) (None, 64) 0
__________________________________________________________________________________________________
dense_1 (Dense) (None, 4096) 266240 h[0][0]
__________________________________________________________________________________________________
reshape (Reshape) (None, 8, 8, 64) 0 dense_1[0][0]
__________________________________________________________________________________________________
conv2d_9 (Conv2D) (None, 8, 8, 64) 36928 reshape[0][0]

While more and more companies are adding “forced arbitration” clauses to their terms of service, only a handful of these businesses are offering customers the choice to opt out of this part of the contract. Here are the reasons why you should take advantage of that option whenever possible.

  1. Forced arbitration takes away your right to file a complaint in a court of law against a company that’s wronged you.

  2. Companies want you to arbitrate because the system has been shown to be heavily unbalanced in favor of businesses — who have the legal knowledge, experience, and funding to put up a proper defense — while harmed consumers often enter into the complicated process without legal representation.

  3. Most arbitration clauses also take away the right of groups of harmed consumers to pool their similar complaints together, forcing each customer into going through a binding arbitration that puts limits on damages; meaning companies can harm large groups of customers but get away with only paying out to those

<div class="row" id="examplemodule">
<h2>Module Name</h2>
<p>Module description.</p>
<div class="panel panel-default">
<div class="panel-heading" role="tab" id="example"> <!-- change id name to command name -->
<h4 class="panel-title">
<a role="button" data-toggle="collapse" aria-expanded="true" aria-controls="example-c" href="#example-c"> <!-- change aria-controls and href to command name-c -->
<b>Command Name</b> - Short Description - !command &lt;args&gt;
</a>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<title>{% block title %}Avrae - Commands{% endblock %}</title>
<!-- Bootstrap -->
def parse_resistances(damage, resistances, immunities, vulnerabilities):
COMMENT_REGEX = r'\[(?P<comment>.*?)\]'
ROLL_STRING_REGEX = r'\[.*?]'
comments = re.findall(COMMENT_REGEX, damage)
roll_strings = re.split(ROLL_STRING_REGEX, damage)
formatted_comments = []
formatted_roll_strings = []