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 inspect | |
import morepath | |
import os | |
from webob import static | |
class App(morepath.App): | |
@property |
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
''' | |
How to test a ODE in sympy properly. | |
See [http://docs.sympy.org/latest/modules/solvers/ode.html#checkodesol] for more | |
''' | |
import sympy as sp | |
x, h = sp.symbols('x h') | |
eq = sp.diff(h(x), x) - h(x) | |
sols = sp.dsolve(eq) | |
sol = sols.rhs |
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
# -*- mode: gitignore; -*- | |
## Core latex/pdflatex auxiliary files: | |
*.aux | |
*.lof | |
*.log | |
*.lot | |
*.fls | |
*.out | |
*.toc |
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
# USSAGE | |
# python make_webworks_csv.py <input.csv> <output.lst> | |
from collections import namedtuple | |
import csv | |
import codecs | |
Student = namedtuple('Student', 'Name Surname Email') | |
WebworkStudent = namedtuple('WebworkStudent', | |
'student_id first_name last_name status comment section recitation email_address user_id') |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<!-- Generated with glade 3.38.2 --> | |
<interface> | |
<requires lib="gtk+" version="3.24"/> | |
<object class="GtkAdjustment" id="adjustment1"> | |
<property name="upper">100</property> | |
<property name="step-increment">1</property> | |
<property name="page-increment">10</property> | |
</object> | |
<object class="GtkAdjustment" id="adjustment2"> |
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
#!/bin/bash | |
USERNAME="writeyourusernmehere" | |
HOST="$USERNAME.mysql.pythonanywhere-services.com" | |
TABLENAME='your table name' | |
NOW=`date --iso-8601=seconds` | |
DBDIR=$HOME/db-backup | |
BACKUP_FILE="$DBDIR"/db-backup-"$NOW".sql.gz | |
mysqldump -u $USERNAME -h $HOST --set-gtid-purged=OFF --no-tablespaces --column-statistics=0 "$TABLENAME" | gzip > "$BACKUP_FILE" |
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
#!/bin/bash | |
$TARGET="the absolute path to the directory hosting your project" | |
cd $TARGET | |
git fetch --all --tags | |
latestTag=`git describe --tags $(git rev-list --tags --max-count=1)` | |
git checkout tags/$latestTag -b $latestTag |
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 secrets import choice | |
import string | |
import argparse | |
ALPHABET = string.ascii_letters + string.digits + string.punctuation | |
def password_generator(len:int =10, alphabet: list[str] = ALPHABET) -> str: | |
return "".join(choice(alphabet) for i in range(len)) | |
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
[Desktop Entry] | |
Comment=A personal knowledge management tool that grows as you do. | |
Comment[es]=Una herramienta de administración de conocmiento personal que crece contigo. | |
Exec=code --no-sandbox --new-window Dendron/dendron.code-workspace | |
Name=Dendron | |
Type=Application | |
StartupWMClass=code | |
Keywords=dendron;notes;pkm; | |
Categories=Utility;TextEditor; |
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
""" | |
# URL to title | |
Simple program that reads an url and prints the last part of the path as a title. | |
## Case of use | |
I use this to format references in my mardown documents. For example, given the url | |
``` |
OlderNewer