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 hashlib as hash | |
# Specify how many bytes of the file you want to open at a time | |
BLOCKSIZE = 1024 * 1024 * 8 # 8mb | |
def hash_file(fname: str): | |
sha = sha256() | |
with open(fname, 'rb') as fh: | |
while buff := fh.read(BLOCKSIZE): | |
sha.update(buff) |
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
<html> | |
<head> | |
<title>AI vs Old Master</title> | |
<link rel="preconnect" href="https://fonts.googleapis.com"> | |
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> | |
<link href="https://fonts.googleapis.com/css2?family=Roboto&display=swap" rel="stylesheet"> | |
<style> | |
@import url('https://fonts.googleapis.com/css2?family=Roboto&display=swap'); | |
body { |
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
name: sdm | |
channels: | |
- pytorch | |
- conda-forge | |
- defaults | |
dependencies: | |
- _libgcc_mutex=0.1=conda_forge | |
- _openmp_mutex=4.5=2_kmp_llvm | |
- abseil-cpp=20211102.0=h27087fc_1 | |
- absl-py=1.2.0=pyhd8ed1ab_0 |
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
const s3 = require('@aws-sdk/client-s3') | |
class SaneS3 { | |
constructor(...args) { | |
this.client = new s3.S3Client(...args) | |
} | |
} | |
Object.entries(s3).forEach((entry) => { | |
let [name, fn] = entry |
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
from flask import Flask | |
from flask_sqlalchemy import SQLAlchemy | |
db = SQLAlchemy() | |
from models import User | |
def create_app(config=None): | |
app = Flask("testing") | |
app.config["SQLALCHEMY_DATABASE_URI"] = "sqlite://" |
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 re | |
import praw | |
import prawcore.exceptions | |
from collections import defaultdict | |
from itertools import product | |
from tqdm import tqdm | |
from pymongo import MongoClient | |
client = praw.Reddit(client_id='client id', client_secret='client secret', user_agent='gender scraper') | |
subs = 'askmen','askwomen' |
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
#!/usr/bin/env python | |
""" | |
pip install -U pygame numpy tensorflow keras opencv-python | |
""" | |
from datetime import datetime | |
import pygame | |
import os | |
import sys | |
import cv2 |
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
from pydotplus import graphviz as pydot | |
class TrieNode: | |
__slots__ = ('text', 'children', 'is_end') | |
def __init__(self, letter, is_end=False): | |
self.text = letter | |
self.children = {} | |
self.is_end = is_end |
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
Rows: 11, cols=1 44 Bytes | |
CL Took: 0:00:00.003606 | |
NP Took: 0:00:00.000021 | |
Rows: 10, cols=3 120 Bytes | |
CL Took: 0:00:00.000312 | |
NP Took: 0:00:00.000012 | |
Rows: 10000, cols=1000 40.0 MB | |
CL Took: 0:00:00.005533 | |
NP Took: 0:00:00.017710 | |
Rows: 50000, cols=1200 240.0 MB |
NewerOlder