Skip to content

Instantly share code, notes, and snippets.

View docPhil99's full-sized avatar

Phil docPhil99

  • University of Sussex
View GitHub Profile
@mhSangar
mhSangar / install-textlive.sh
Created April 21, 2021 23:45
Latex Workshop VSCode settings for Biber and pdflatex and installation steps for textlive
#!/bin/bash
echo "Installing TextLive"
sudo apt install -y texlive-latex-extra
sudo apt install -y texlive-lang-english texlive-lang-spanish texlive-bibtex-extra
# sudo apt autoremove
@busycalibrating
busycalibrating / app.py
Created October 7, 2020 00:02
Dash plot.ly sending numpy with ZMQ pub/sub pyobj (Python 3)
# Largely a copy of the great gist by Danny Price (https://github.com/telegraphic)
# Minimal modifications to make the example work with Python 3, and to send
# python objects instead of using the msgpack library.
#
# Original gist can be found here:
# https://gist.github.com/telegraphic/2709b7e6edc3a0c39ed9b75452da205
"""
# app.py - example Dash + ZMQ + msgpack + numpy monitor
This app receives data from zmq_pub.py, and plots it.
@docPhil99
docPhil99 / arg_parse_demo.py
Last active February 13, 2026 17:11
Simple demo of argparse in python
"""Simple demo of argparse in python, see http://zetcode.com/python/argparse/"""
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('name') # positional argument, note no dash!
parser.add_argument('-n', type=int, required=True, help="the number") # Required argument, must be a int, eg. -n 4
parser.add_argument('-e', type=int, default=2, help="defines the value") # Optional argument with a default
parser.add_argument('-o', '--output', action='store_true', help="shows output") # a binary flag
@daeh
daeh / Papers3_to_Zotero.py
Last active September 6, 2024 18:58
Import Papers 3 library into Zotero
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Script to facilitate the import of a Readcube Papers 3 library into Zotero
__Purpose of this script__
If you export your Readcube (Mekentosj) Papers3 library as a BibTeX file, the file paths to the PDFs are not formatted
correctly for Zotero to import them.
@wassname
wassname / to_filename.py
Last active March 14, 2025 09:54
python convert string to safe filename
"""
Url: https://gist.github.com/wassname/1393c4a57cfcbf03641dbc31886123b8
"""
import unicodedata
import string
valid_filename_chars = "-_.() %s%s" % (string.ascii_letters, string.digits)
char_limit = 255
def clean_filename(filename, whitelist=valid_filename_chars, replace=' '):
@baraldilorenzo
baraldilorenzo / readme.md
Last active September 13, 2025 12:17
VGG-16 pre-trained model for Keras

##VGG16 model for Keras

This is the Keras model of the 16-layer network used by the VGG team in the ILSVRC-2014 competition.

It has been obtained by directly converting the Caffe model provived by the authors.

Details about the network architecture can be found in the following arXiv paper:

Very Deep Convolutional Networks for Large-Scale Image Recognition

K. Simonyan, A. Zisserman