Skip to content

Instantly share code, notes, and snippets.

View prestonw's full-sized avatar

Will prestonw

View GitHub Profile
@prestonw
prestonw / README.md
Last active September 5, 2023 08:48 — forked from gmemstr/Pipfile
Speedtest against Hetzner servers

Hetzner Speedtest

This Python application serves as a rudimentary speed test utility designed to evaluate network performance against public Hetzner endpoints. The tool not only measures download speeds but also provides approximate latency metrics to various Hetzner data centers for a comprehensive network assessment.

usage

python hetzner-speedtest.py [lg|md|sm] -v

-v is optional to enter verbose mode

@prestonw
prestonw / Colours.py
Created July 19, 2023 01:02
ChatGPT generated Spreadsheet styled with Colours
import pandas as pd
import numpy as np
from random import randint
from openpyxl import load_workbook
from openpyxl.styles import PatternFill, Font, Border, Side
from openpyxl.utils import get_column_letter
import colorsys
import hashlib
# Define the colours and their popularity (1-10)
Handlebars is a semantic web template system, started by Yehuda Katz in 2010.
Handlebars.js is a superset of Mustache, and can render Mustache templates in addition to Handlebars templates.
More: http://handlebarsjs.com/
1. Expressions.
1.1 Basic usage.
@prestonw
prestonw / woo-autocomplete.php
Last active July 7, 2020 14:52
Simply create a mu-plugin folder in your wp-content folder and add this woo-autocomplete.php file.
<?php
defined( 'ABSPATH' ) or die( 'Go Away!' );
/**
* Plugin Name: WooCommerce AutoComplete Plugin
* Description: AutoComplete all sales on WooCommerce.
* Author: Will Preston
* License: GNU General Public License v3 or later
* License URI: http://www.gnu.org/licenses/gpl-3.0.html
*/
/**
* Retrieves all the rows in the active spreadsheet that contain data and logs the
* values for each row.
* For more information on using the Spreadsheet API, see
* https://developers.google.com/apps-script/service_spreadsheet
*/
function readRows() {
var sheet = SpreadsheetApp.getActiveSheet();
var rows = sheet.getDataRange();
var numRows = rows.getNumRows();
/**
* Retrieves all the rows in the active spreadsheet that contain data and logs the
* values for each row.
* For more information on using the Spreadsheet API, see
* https://developers.google.com/apps-script/service_spreadsheet
*/
function readRows() {
var sheet = SpreadsheetApp.getActiveSheet();
var rows = sheet.getDataRange();
var numRows = rows.getNumRows();
@prestonw
prestonw / Botnet IP Addresses
Last active October 1, 2019 02:43
Botnet created on RunCloud
1.1.181.16
1.1.182.22
1.1.224.163
1.10.140.43
1.10.178.198
1.10.186.114
1.10.186.135
1.10.186.219
1.10.186.228
1.10.186.35
@prestonw
prestonw / Contract Killer 3.md
Created April 3, 2019 16:52 — forked from malarkey/Contract Killer 3.md
The latest version of my ‘killer contract’ for web designers and developers

Contract Killer

The popular open-source contract for web professionals by Stuff & Nonsense

  • Originally published: 23rd December 2008
  • Revised date: March 15th 2016
  • Original post

@prestonw
prestonw / Sticky Header on Mobile
Last active June 4, 2021 14:42
Beaver Themer : Sticky Header on Mobile #willwp #bbforum
@media (max-width:1150px) {
.fl-builder-content-300[data-type="part"]{
z-index: 999;
min-width: 100%;
width: 100%;
position: -webkit-sticky;
position: sticky;
top: 0;
}
@prestonw
prestonw / Pods.php
Created February 1, 2018 17:29
Pods attachments
<?php
if ( get_post_meta( get_the_ID(), 'image_field', false ) ){
$image_array = get_post_meta( get_the_ID(), 'image_field', false );
}
if ( $image_array ) {
echo '<ul>';
foreach ( $image_array as $image ) {
$class = "post-attachment mime-" . sanitize_title( $image->post_mime_type );
$thumbimg = wp_get_attachment_image( $image['ID'], 'thumbnail');
echo '<li class="' . $class . ' data-design-thumbnail">' . $thumbimg . '</li>';