Skip to content

Instantly share code, notes, and snippets.

@specter119
specter119 / zot_rm_unmaintained_files.py
Last active March 11, 2024 11:05
remove files not maintained by zotero
#!/usr/bin/env python
# coding: utf-8
from __future__ import print_function
import configparser
import re
import shutil
import sqlite3
import sys
@specter119
specter119 / periodic_table.py
Last active December 1, 2023 11:20
Plot periodic table with Pymatgen and Matplotlib
import re
import matplotlib.patches as mpatches
import matplotlib.pyplot as plt
import numpy as np
from matplotlib.collections import PatchCollection
from pymatgen.core.periodic_table import Element
class PeriodicTablePlotter(object):
@specter119
specter119 / flex.grub
Created March 6, 2023 13:15 — forked from DennisLfromGA/flex.grub
Script for ChromeOS Flex to add cros_debug / dev mode option in grub.cfg
### Script to add cros_debug / dev mode option in grub.cfg
### ( Each Flex update removes cros_debug / dev mode option
### Be sure to run this script AFTER each update and BEFORE rebooting )
ANS=
ROOTDEVICE=
ROOTDEVICEPREFIX=
P12MOUNTPOINT=/var/p12
GRUBCFGPATH=$P12MOUNTPOINT/efi/boot
GRUBCFGFILE=grub.cfg
@specter119
specter119 / zot_rm_empty_folders.py
Last active February 1, 2023 07:44
remove empty folders in `storage`
#!/usr/bin/env python
# coding: utf-8
from __future__ import print_function
import configparser
import re
import shutil
import sys
@specter119
specter119 / fix_csl_gbt7714.vb
Last active January 6, 2021 03:15
Fix multiple locale et al in GB/T 7714 bibliography generated by Zotero(csl) for MS-Word
Sub deng2etal()
'
' deng2etal macro
' English等 -> english, et al
'
With Selection.Find
.Forward = True
.ClearFormatting
.Text = "(<[A-z]@)等"
With .Replacement
@specter119
specter119 / export-ble-infos.py
Created September 29, 2020 11:30 — forked from 5shekel/export-ble-infos.py
Export your Windows Bluetooth LE keys into Linux!
#!/usr/bin/python3
"""
Export your Windows Bluetooth LE keys into Linux! (arch edition)
Thanks to: http://console.systems/2014/09/how-to-pair-low-energy-le-bluetooth.html
discussed here: https://unix.stackexchange.com/questions/402488/dual-boot-bluetooth-device-pairing
Usage:
$ ./export-ble-infos.py <args>
$ sudo bash -c 'cp -r ./bluetooth /var/lib'
@specter119
specter119 / papirus-icon-kde.hook
Last active November 11, 2019 11:12
papirus-icon-kde.hook should put in /usr/share/libalpm/hooks/, fix "gnome" not found.
[Trigger]
Operation = Install
Operation = Upgrade
Type = Path
Target = usr/share/icons/*Papirus*/index.theme
[Action]
Description = Remove unused theme name from papirus-icon-theme
When = PostTransaction
Exec = /bin/sh -c "/usr/bin/sed -i.orig '/Inherits/ s/gnome,\?//g' /usr/share/icons/{ePapirus,Papirus,Papirus-Light,Papirus-Dark}/index.theme"
@specter119
specter119 / PKGBUILD
Created November 11, 2019 06:12
ttf-ms-win10 with more chinese fonts
# Maintainer: Michael Lass <bevan@bi-co.net>
# Maintainer: Doug Newgard <scimmia at archlinux dot info>
# Contributor: reflexing <reflexing@reflexing.ru>
# Instructions were copied from ttf-ms-win8 and slightly modified:
#
# BUILD INSTRUCTIONS:
# -------------------
#
# Please note, that usage of Microsoft fonts outside running Windows
@specter119
specter119 / aur-matlab.patch
Last active May 13, 2019 04:49
patch for AUR Matlab to enable login installation
diff --git a/PKGBUILD b/PKGBUILD
index a97c0b9..7b37fba 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -40,6 +40,7 @@
# partial install
_partialinstall=false
+_logininstall=true
@specter119
specter119 / Microsoft_Office_2019_VL_Serializer.pkg
Created February 8, 2019 12:49 — forked from zthxxx/Activate Office 2019 for macOS VoL.md
crack activate office on mac with license file
This file has been truncated, but you can view the full file.