Skip to content

Instantly share code, notes, and snippets.

@ChristophRudisch
ChristophRudisch / flowlayout.py
Created April 24, 2025 06:21 — forked from aspadm/flowlayout.py
Python: PyQt5 FlowLayout
from PyQt5 import QtCore, QtWidgets
class FlowLayout(QtWidgets.QLayout):
def __init__(self, parent=None, margin=0, spacing=-1):
super().__init__(parent)
if parent is not None:
self.setContentsMargins(margin)
self.setSpacing(spacing)
@tyano463
tyano463 / annot.c
Created April 24, 2025 06:20
mupdf annotation sample
static void add_ink_annot_sample(const char *input_pdf)
{
const char *output_pdf = next_file_name(input_pdf);
fz_context *ctx = fz_new_context(NULL, NULL, FZ_STORE_UNLIMITED);
fz_try(ctx)
{
pdf_document *doc = pdf_open_document(ctx, input_pdf);
fz_page *page = fz_load_page(ctx, (fz_document *)doc, 0);
pdf_page *pdfpage = (pdf_page *)page;
@andrewlimaza
andrewlimaza / ffl_pmpro_member_panel.php
Last active April 24, 2025 06:21
Force First and Last Name as Display Name with Paid Memberships Pro Edit Member
<?php
/**
* Enable functionality for the Edit Member Panel when saving user info.
* Add this code to your site, follow this guide - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
**/
function my_custom_ffl_fix_user_display_name() {
// Make sure Force First and Last Name is installed.
if ( ! function_exists( 'ffl_fix_user_display_name' ) ) {
return;
@choco-bot
choco-bot / FilesSnapshot.xml
Created April 24, 2025 06:19
chromedriver v135.0.7049.114 - Passed - Package Tests Results
<?xml version="1.0" encoding="utf-8"?>
<fileSnapshot xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<files>
<file path="C:\ProgramData\chocolatey\lib\chromedriver\chromedriver-win64.zip.txt" checksum="CFC27631840C495DD2EADA6B95A7BCC2" />
<file path="C:\ProgramData\chocolatey\lib\chromedriver\chromedriver.nupkg" checksum="DEC7271944F29159017028CA56F66FA6" />
<file path="C:\ProgramData\chocolatey\lib\chromedriver\chromedriver.nuspec" checksum="6FC26F77BD497CCC7D454457414E57DA" />
<file path="C:\ProgramData\chocolatey\lib\chromedriver\tools\chocolateyinstall.ps1" checksum="CC44DADB60CEC3AF4E02992E084646AE" />
<file path="C:\ProgramData\chocolatey\lib\chromedriver\tools\chromedriver-win64\chromedriver.exe" checksum="8AA6451DC08875D5DEDEF48DADDA1CF5" />
<file path="C:\ProgramData\chocolatey\lib\chromedriver\tools\chromedriver-win64\LICENSE.chromedriver" checksum="C408A301E3407C3803499CE9290515D6" />
<file path="C:\ProgramDa
@matjahs
matjahs / mongo_prune.js
Created April 24, 2025 06:19
Prune stale data from Unifi Controller
/**
Usage:
1. ssh root@<UDM-Pro IP or hostname>
2. wget -O /tmp/mongo_prune.js https://gist.github.com/matjahs/bc895b6ae5b3e796783d306f7f7fde09/raw/30e1a8cf1c63c62e28e690d0dbc730e30b3d75de/mongo_prune.js
3. mongo --port 27117 --quiet --eval "var days=14, dryrun=true" /tmp/mongo_prune.js
**/
if (!days) {
throw new Error('days not defined');
exit(1);
@choco-bot
choco-bot / FilesSnapshot.xml
Created April 24, 2025 06:17
nginx-service v1.27.5-mainline - Passed - Package Tests Results
<?xml version="1.0" encoding="utf-8"?>
<fileSnapshot xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<files>
<file path="C:\ProgramData\chocolatey\lib\nginx-service\nginx-service.nupkg" checksum="6EA3AA70D9D6595B32F1281D579656B8" />
<file path="C:\ProgramData\chocolatey\lib\nginx-service\nginx-service.nuspec" checksum="99E90EE70D732F82C4D8AAC3ED61B4E2" />
<file path="C:\ProgramData\chocolatey\lib\nginx-service\bin\nginx.exe" checksum="322805FC07A06F006B7BB498F3CFFCD1" />
<file path="C:\ProgramData\chocolatey\lib\nginx-service\bin\nginx.exe.ignore" checksum="5634239FCDCB46B5FFDD6EB31E3067C3" />
<file path="C:\ProgramData\chocolatey\lib\nginx-service\bin\nginx.zip" checksum="82305AEC8811BCEF365AD350610CBD34" />
<file path="C:\ProgramData\chocolatey\lib\nginx-service\bin\conf\fastcgi.conf" checksum="C7410CB0F3605B4201888C91FBA1DED2" />
<file path="C:\ProgramData\chocolatey\lib\nginx-service\bin\conf\fastcgi_params" checksu
#======================================================================
# CRYSTAL DATA
#----------------------------------------------------------------------
data_VESTA_phase_1
_chemical_name_common 'Cr0.5 In0.5 Si Te3'
_cell_length_a 6.890000
_cell_length_b 6.890000
_cell_length_c 21.018000
@jaysonlong
jaysonlong / idea_decompile.sh
Created April 24, 2025 06:17
Using IDEA buit-in decompiler to decompile java class files
java -cp "D:\\JetBrains\\IntelliJ IDEA\\plugins\\java-decompiler\\lib\\java-decompiler.jar" org.jetbrains.java.decompiler.main.decompiler.ConsoleDecompiler -dgs=true "D:\\classDir" "D:\\srcDir"
#requires -Version 3.0
<#
.SYNOPSIS
My Veeam Report is a flexible reporting script for Veeam Backup and
Replication.
.DESCRIPTION
My Veeam Report is a flexible reporting script for Veeam Backup and
Replication. This report can be customized to report on Backup, Replication,