Skip to content

Instantly share code, notes, and snippets.

View unkwn1-repo's full-sized avatar

unkwn1 unkwn1-repo

View GitHub Profile
@unkwn1-repo
unkwn1-repo / com.python.launchd.agent.plist
Created June 18, 2019 06:28
An example launchd plist file. The launchd agent will first change the working directory, set the arguements and, execute a python script. This is a minimalist launchd template that can easily be expanded upon.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.nuntium.fetchnews.agent</string>
<key>ProgramArguments</key>
<array>
<string>/usr/local/bin/python3</string>
<string>nuntium.py</string>
@unkwn1-repo
unkwn1-repo / tweet-archive-converter.py
Last active August 3, 2023 18:19
Simple JSON to CSV Method for Twitter Archive Data
#!/usr/bin/env python3
'''
IMPORTANT: Please delete the following from the tweet.js file before using this:
---> window.YTD.tweet.part0 = <----
Whilst that remains you cant parse it easily with json.load
'''
import pandas as pd
import json
from pandas.io.json import json_normalize
@unkwn1-repo
unkwn1-repo / setup.cfg
Created May 3, 2021 12:49 — forked from althonos/setup.cfg
A `setup.cfg` template for my Python projects
# https://gist.github.com/althonos/6914b896789d3f2078d1e6237642c35c
[metadata]
name = {name}
version = file: {name}/_version.txt
author = Martin Larralde
author_email = martin.larralde@embl.de
url = https://github.com/althonos/{name}
description = {description}
long_description = file: README.md
@unkwn1-repo
unkwn1-repo / pip-upgrade-modules.md
Last active July 11, 2021 14:49
A one liner I use to auto update any outdated pip modules in an environment

Updating Pip Packages

checks and auto updates

pip install -U $(pip list --outdated | awk 'NR>2 {print $1}')

check for outdated modules

pip list --outdated

awk

  • prints out the first columns of the pip oudated command using NR&gt;2 to filter the first 2 rows.
@unkwn1-repo
unkwn1-repo / delete_all-docker-images.sh
Created March 15, 2022 16:43
A command i used to delete all docker images I had. Only suitable for a mass deletion.
# Assumes you're in the docker group
# if not, run `sudo usermod -aG docker $USER`
# Column $3 is the image IDs
docker images | for i in `awk 'NR>1{print $3}'`; do docker rmi $i; done