This file contains hidden or 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 tinydb import TinyDB, Query | |
db = TinyDB("path/to/your.db.json") | |
q = Query() | |
# the items that should be remove have stringXYZ in field name | |
db.remove(q.name.search('stringXYZ')) |
This file contains hidden or 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 gcc | |
# Install MPI | |
ENV MPI_VERSION 3.3.1 | |
RUN wget http://www.mpich.org/static/downloads/${MPI_VERSION}/mpich-${MPI_VERSION}.tar.gz &&\ | |
tar xfz mpich-${MPI_VERSION}.tar.gz &&\ | |
cd mpich-${MPI_VERSION} &&\ | |
./configure &&\ | |
make -j 4 &&\ | |
make -j 4 install |
This file contains hidden or 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 gcc | |
# Install MPI | |
ENV MPI_VERSION 3.3.1 | |
RUN wget http://www.mpich.org/static/downloads/${MPI_VERSION}/mpich-${MPI_VERSION}.tar.gz &&\ | |
tar xfz mpich-${MPI_VERSION}.tar.gz &&\ | |
cd mpich-${MPI_VERSION} &&\ | |
./configure &&\ | |
make -j 4 &&\ | |
make -j 4 install |
This file contains hidden or 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
function md_table | |
set header "| header | header |\n| ------ | ------ |\n" | |
for i in *.cpp; | |
set -a header "| $i | |\n"; | |
end; | |
printf "$header"; | |
end |
This file contains hidden or 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 nlknguyen/alpine-mpich | |
FROM gcc | |
# Update the containers to install fish | |
RUN apt-get update | |
RUN apt-get upgrade -y | |
RUN apt-get install -y fish vim | |
# Install PNG Library | |
RUN wget https://download.savannah.nongnu.org/releases/pngpp/png++-0.2.9.tar.gz |
This file contains hidden or 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 sympy import * | |
init_printing() | |
i, j = symbols('i j', cls=Idx) | |
b = IndexedBase('b') | |
c = IndexedBase('c') | |
alpha = IndexedBase('alpha') | |
Sum(b[i]*alpha[i,j]*c[j], (i, 1, 3), (j, 1,3)).doit() |
This file contains hidden or 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
# Selecting the Operating System | |
FROM ubuntu:18.04 | |
# Updating | |
RUN apt-get -y update && apt-get -y upgrade && apt-get -y install wget git gnupg gnupg2 gnupg1 software-properties-common vim | |
RUN sh -c "wget -qO - http://dl.openfoam.org/gpg.key | apt-key add -" | |
# Setup OpenFoam | |
RUN add-apt-repository http://dl.openfoam.org/ubuntu | |
RUN apt-get update | |
RUN apt-get -y install openfoam5 |
This file contains hidden or 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
# Creating Function to write Email as EML File to Disk | |
def save_message(message_admin, request, queryset): | |
i = 0 | |
for message in queryset.all(): | |
eml_content = message.get_email_object().as_bytes() | |
file_name = f"some_file_path/{message.subject}_{i}.eml" | |
print(file_name) | |
with open(file_name, "wb") as outfile: | |
outfile.write(eml_content) | |
i += 1 |
This file contains hidden or 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 requests | |
from bs4 import BeautifulSoup as soup | |
import os | |
# Define Website to Download pdf | |
url = 'website to download pdfs' | |
# Get Website content | |
r = requests.get(url) |
NewerOlder