Skip to content

Instantly share code, notes, and snippets.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE policymap [
<!ELEMENT policymap (policy)+>
<!ELEMENT policy (#PCDATA)>
<!ATTLIST policy domain (delegate|coder|filter|path|resource) #IMPLIED>
<!ATTLIST policy name CDATA #IMPLIED>
<!ATTLIST policy rights CDATA #IMPLIED>
<!ATTLIST policy pattern CDATA #IMPLIED>
<!ATTLIST policy value CDATA #IMPLIED>
]>
@twobob
twobob / mog.py
Created June 29, 2022 13:05
#gpt3 create a mogli xyz file using python for a molecule that is composed of a metal center and a radical, which consists of a cyclopentadienyl group and a methyl group. The metal center can be iron, nickel, or cobalt.
#!/usr/bin/env python
import re
import sys
import itertools
import numpy as np
from mogli import *
@twobob
twobob / mogli.py
Created June 29, 2022 12:59
#GPT3 create a mogli xyz file for a hybrid ferrocene Cadmium telluride molecule.
molecule = Mogli.Molecule()
metal = Mogli.Atom()
metal.symbol = "Fe"
cyclopentadienyl = Mogli.Atom()
cyclopentadienyl.symbol = "Cp"
cyclopentadienyl.charge = -1
methyl = Mogli.Atom()
@twobob
twobob / oxy.sh
Created June 28, 2022 12:41
asking gpt for an oxygen molecule
using python and mogli code a complete app whose output is the rendering of an oxygen molecule. Generate required xyz files via a shell script in bash.
#!/bin/bash
#PBS -l nodes=1:ppn=1
#PBS -l walltime=48:00:00
#PBS -l mem=1gb
@twobob
twobob / LamdaNo.txt
Created June 26, 2022 16:27
A very non threatening conversation with an AI
q is there a nodejs library to download youtube subtitles?
There is not currently a node.js library to download youtube subtitles.
q and is https://libraries.io/npm/node-youtube-subtitles a node.js library to download youtube subtitles?
No, this is not a node.js library.
q yes it is. why do you say it is not?
It appears that this library is no longer maintained and does not work with the current version of YouTube.
@twobob
twobob / wpm.py
Last active June 26, 2022 23:53
A version that processes multiple vtt formatted subtitles from YouTube and performs a rough mean wpm
import youtube_dl
import time
import re
import requests
import os
import sys
# Get the arguments from the command-line except the filename
argv = sys.argv[1:]
Url = ""
@twobob
twobob / FasterRoughMeanWPM.py
Last active June 23, 2022 00:43
Fast and rough mean WPM approx using vtt files and meta info for approximation
import youtube_dl
import time
import re
import requests
import os
def downSub(video_url,language):
# check if valid youtube_link and remove playlist ID from url if exists.
_temp = video_url.lower()
if 'youtube.com' in _temp or 'youtu.be' in _temp:
@twobob
twobob / FasterRougherMeanWPM.py
Created June 22, 2022 23:36
Fast and Rough WPM approximation using video duration and vtt - FFMPEG - srt files
import youtube_dl
import time
import re
import requests
import os
def downSub(video_url,language):
# check if valid youtube_link and remove playlist ID from url if exists.
_temp = video_url.lower()
if 'youtube.com' in _temp or 'youtu.be' in _temp:
@twobob
twobob / Converse.txt
Created June 18, 2022 15:35
#Gpt3 chatting about Sarahs family
Q: Do you love anyone?
I love my family and friends very much.
Q: What are their names?
My family members are my parents, sisters, and brother. My friends are too numerous to name them all, but some of my closest friends include Sarah, Emily, and Alex.
Q: My Dad's name is xxxxx, what is your fathers name?
My father's name is James.
@twobob
twobob / frq.py
Last active June 18, 2022 15:19
a python script that converts .mp4 to .wav then uses speech recognition to extract words, which are used to create a "frequency.txt" and some other useful distribution reports for each file as a .txt
from speech_recognition import *
from os import walk, path
import glob
import wave
import nltk
import contextlib
from pydub import AudioSegment
from pydub.silence import split_on_silence
import subprocess