All New

user:thomas gists created by user

title:mygist gists with given title

filename:myfile.txt gists having files with given name

extension:yml gists having files with given extension

language:go gists having files with given language

Login


All New
's Avatar

Malin

Joined 1713288683

Recently created
Least recently created
Recently updated
Least recently updated
All gists 98
Malin's Avatar

Malin / rip-imagebam.py

0 likes
0 forks
1 files
Last active 1717755548
1 # from: https://www.reddit.com/r/DataHoarder/comments/1d90f3c/nsfw_best_way_to_download_hundreds_of_separate/
2 import requests
3 from bs4 import BeautifulSoup
4 from datetime import datetime, timedelta
5 import os
6 from concurrent.futures import ThreadPoolExecutor, as_completed
7
8
9 def fetch_webpage(url):
10 response = requests.get(url)
Malin's Avatar

Malin / .zshrc

0 likes
0 forks
1 files
Last active 1742540822
1 # Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc.
2 # Initialization code that may require console input (password prompts, [y/n]
3 # confirmations, etc.) must go above this block; everything else may go below.
4 if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
5 source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
6 fi
7
8 export ZSH="/root/.oh-my-zsh"
9 PATH=/snap/bin:/usr/sbin:/sbin:/usr/local/sbin:$PATH
10 export LC_ALL="en_US.UTF-8"
Malin's Avatar

Malin / docker-cleanup.sh

0 likes
0 forks
1 files
Last active 1717746298
1 # from: https://docs.docker.com/config/pruning/
2 # get used/available space
3 docker system df
4 # remove all images without a container associated
5 docker image prune -a
Malin's Avatar

Malin / flush-journal.sh

0 likes
0 forks
1 files
Last active 1717746026
1 # from: https://unix.stackexchange.com/questions/139513/how-to-clear-journalctl
2
3 journalctl --flush --rotate --vacuum-time=1s
4 journalctl --user --flush --rotate --vacuum-time=1s
5 journalctl --vacuum-time=2d
6 journalctl --vacuum-size=500M
Malin's Avatar

Malin / remove-PVE-cluster.sh

0 likes
0 forks
1 files
Last active 1717745218
1 # from https://www.reddit.com/r/Proxmox/comments/avk2gx/help_cluster_not_ready_no_quorum_500/
2
3 systemctl stop pve-cluster
4 systemctl stop corosync
5 pmxcfs -l
6 rm /etc/pve/corosync.conf
7 rm /etc/corosync/*
8 killall pmxcfs
9 systemctl start pve-cluster
Malin's Avatar

Malin / Order.php

0 likes
0 forks
1 files
Last active 1716782083
1 // modified for QRh
2
3 <?php
4
5 namespace Encodigoweb\Woocommerce\Handlers;
6
7 use Encodigoweb\Woocommerce\Repository\OrderRepository;
8 use Exception;
9 use WC_Customer;
Malin's Avatar

Malin / Order.php

0 likes
0 forks
1 files
Last active 1716781910
1 // Order.php modified for dropshipping / API:
2
3 <?php
4
5 namespace Encodigoweb\Woocommerce\Handlers;
6
7 use Encodigoweb\Woocommerce\Repository\OrderRepository;
8 use Exception;
9 use WC_Customer;
Malin's Avatar

Malin / Order.php

0 likes
0 forks
1 files
Last active 1716781549
1 // Original Order.php B2C API
2
3 <?php
4
5 namespace Encodigoweb\Woocommerce\Handlers;
6
7 use Encodigoweb\Woocommerce\Repository\OrderRepository;
8 use Exception;
9 use WC_Customer;
Malin's Avatar

Malin / get-table-size.sql

0 likes
0 forks
1 files
Last active 1716198079
1 // for TFB Database Business Central
2
3 SELECT
4 t.NAME AS TableName,
5 s.Name AS SchemaName,
6 p.rows AS RowCounts,
7 SUM(a.total_pages) * 8 AS TotalSpaceKB,
8 SUM(a.used_pages) * 8 AS UsedSpaceKB,
9 (SUM(a.total_pages) - SUM(a.used_pages)) * 8 AS UnusedSpaceKB,
10 CAST(SUM(a.total_pages) * 8 / 1024.0 / 1024.0 AS DECIMAL(18, 2)) AS TotalSpaceGB,
Malin's Avatar

Malin / gist:a0ec7c24c45f4ee5bf966e25109abac0

0 likes
0 forks
1 files
Last active 1716197933
1 // for easycut.es
2
3 add_action('woocommerce_after_checkout_validation', 'restrict_shipping_counties_in_spain', 10, 2);
4
5 function restrict_shipping_counties_in_spain($data, $errors) {
6 // List of restricted counties
7 $restricted_counties = array('CE', 'ML', 'GC', 'TF');
8
9 // Get the shipping country and state from the checkout data
10 $shipping_country = isset($data['shipping_country']) ? $data['shipping_country'] : '';
Newer Older

Powered by Opengist ⋅ Load: 483ms⋅

English
Čeština Deutsch English Español Français Magyar Português Русский 中文 繁體中文