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
# Use to merge docker files together and output them as one single file. | |
# Usage: python docker_compose_combine.py -f docker-compose1.yaml -f docker-compose2.yaml | |
# Courtesy of our good friend ChatGPT. | |
import argparse | |
import yaml | |
from collections import OrderedDict |
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
// Compare two tuples for array.sort(); i.e. returns 1 if first item is larger; 2 if second item is larger, using the < operator. | |
// Similar to the std::tie comparison in c++: https://bajamircea.github.io/coding/cpp/2017/03/10/std-tie.html | |
type Comparable = number | string; | |
const tupleCompare = (a: Comparable[], b: Comparable[]) => { | |
return a.reduce((prev, el, idx) => { | |
if (prev != 0) return prev; | |
else { | |
if (el > b[idx]) return 1; | |
else if (el < b[idx]) return -1; |
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 typing import Dict, List, Any | |
import inspect | |
Result = Any | |
global_run_cache: Dict[int, Result] = {} | |
def cached_function(fn): | |
def wrapper(*args, **kwargs): | |
global global_run_cache | |
consty_types = [str, int, float] |
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
(() => { | |
Element.prototype.pre_doubleclick_addEventListener = Element.prototype.addEventListener; | |
Element.prototype.addEventListener = function (ename, fn) { | |
let clickCount = 0; | |
let singleClickTimer = 0; | |
if (ename == "dblclick") { | |
this.pre_doubleclick_addEventListener("click", (e) => { | |
clickCount++; | |
if (clickCount == 1) { | |
singleClickTimer = setTimeout(function () { |
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 modules | |
import os.path | |
from gensim import corpora | |
from gensim.models import LsiModel | |
from nltk.tokenize import RegexpTokenizer | |
from nltk.corpus import stopwords | |
from nltk.stem.porter import PorterStemmer | |
from gensim.models.coherencemodel import CoherenceModel | |
from multiprocessing import freeze_support | |
import matplotlib.pyplot as plt |
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
people | |
history | |
way | |
art | |
world | |
information | |
map | |
two | |
family | |
government |
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
Lorem ipsum dolor sit amet, consectetur adipiscing elit. | |
Praesent at malesuada mi. | |
Quisque suscipit, arcu non viverra iaculis, magna sapien consequat quam, non fringilla nunc nunc at leo. | |
Etiam rhoncus non ligula non finibus. | |
Phasellus congue tincidunt tortor aliquet volutpat. | |
Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. | |
Maecenas eget nisi mi. | |
Sed congue aliquam viverra. | |
Pellentesque quis lectus velit. | |
Cras consequat velit sed ante viverra blandit. |
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
[Intro] | |
[Verse 1] | |
We're no strangers to love | |
You know the rules and so do I | |
A full commitment's what I'm thinking of | |
You wouldn't get this from any other guy | |
[Pre-Chorus 1] | |
I just wanna tell you how I'm feeling |
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 | |
import os | |
import librosa | |
import random | |
import pyaudio | |
import numpy as np | |
import time | |
p = pyaudio.PyAudio() | |
# Open stream with correct settings |
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
var date_parser_regexes = { | |
time: /(?:(?:(\d+)\/(\d+)(?:\/(\d+))?)|(?:(\d+):(\d+)(?::(\d+))?\s*|(am|pm)))/g, | |
hourOnlyTime: /^(\d+)(am|pm)/g, | |
dayofweek: /(?:(mon)|(tue)s*|(?:(wed)(?:nes)*)|(?:(thu)r*s*)|(fri)|(sat)(?:ur)*|(sun))(?:day)*/ig, | |
plusTime: /\+(\d+)(?:(m)(?:in)*|(h)(?:ou)*(?:r)*|(d)(?:ay)*|(w)(?:ee)*(?:k)*|(M)(?:o)*(?:nth)*|(y(?:ea)*(?:r)*))/g, | |
done: /done/g, | |
auto: /auto/g, | |
now: /now/g, | |
waiting: /waiting/g, |