Skip to content

Instantly share code, notes, and snippets.

@simonlk
simonlk / wc-name-your-price-cart-url
Created March 26, 2014 03:12
WooCommerce Name Your Price Plugin add to cart by URL
This isn't code, just a tip that will hopefully get picked up by search engines for anyone that needs it (me when I have this problem next).
domain.com/cart/?add-to-cart=15998&credit_called[15998]=44
Where 15998 is the product ID
@spivurno
spivurno / gw-gravity-forms-edit-products.php
Last active July 13, 2021 00:15
Gravity Wiz // Gravity Forms // Edit Products on Entry Detail
<?php
/**
* WARNING! THIS SNIPPET MAY BE OUTDATED.
* The latest version of this snippet can be found in the Gravity Wiz Snippet Library:
* https://github.com/gravitywiz/snippet-library/blob/master/gravity-forms/gw-edit-product-and-payment-details.php
*/
/**
* Gravity Wiz // Gravity Forms // Edit Products & Payment Details
*
* Edit products (and payment details) via the Gravity Forms Edit Entry view.
@spivurno
spivurno / gw-gravity-forms-value-exists-validation.php
Last active March 24, 2021 16:08
Gravity Wiz // Gravity Forms // Validate that a Value Exists
<?php
/**
* WARNING! THIS SNIPPET MAY BE OUTDATED.
* The latest version of this snippet can be found in the Gravity Wiz Snippet Library:
* https://github.com/gravitywiz/snippet-library/blob/master/gravity-forms/gw-validate-that-a-value-exists.php
*/
/**
* Gravity Wiz // Gravity Forms // Validate that a Value Exists
*
* Ensure that a value entered in Form A has been previously submitted on Form B. This is useful if you're generating a reference number of some sort
@IISResetMe
IISResetMe / Get-MachineSID.ps1
Created December 30, 2014 15:40
PsGetSid local machine SID implementation in PowerShell
function Get-MachineSID
{
param(
[switch]
$DomainSID
)
# Retrieve the Win32_ComputerSystem class and determine if machine is a Domain Controller
$WmiComputerSystem = Get-WmiObject -Class Win32_ComputerSystem
$IsDomainController = $WmiComputerSystem.DomainRole -ge 4
@spivurno
spivurno / gw-gravity-forms-disable-submission-on-enter.js
Last active October 13, 2021 14:44
Gravity Wiz // Gravity Forms // Disable Submission when Pressing Enter
<script type="text/javascript">
/**
* Gravity Wiz // Gravity Forms // Disable Submission when Pressing Enter
* http://gravitywiz.com/disable-submission-when-pressing-enter-for-gravity-forms/
*/
jQuery(document).on( 'keypress', '.gform_wrapper', function (e) {
var code = e.keyCode || e.which;
if ( code == 13 && ! jQuery( e.target ).is( 'textarea,input[type="submit"],input[type="button"]' ) ) {
e.preventDefault();
return false;
@haasn
haasn / about:config.md
Last active April 2, 2024 18:46
Firefox bullshit removal via about:config

Firefox bullshit removal

Updated: Just use qutebrowser (and disable javascript). The web is done for.

@alirobe
alirobe / reclaimWindows10.ps1
Last active May 22, 2024 20:58
This Windows 10 Setup Script turns off a bunch of unnecessary Windows 10 telemetery, bloatware, & privacy things. Not guaranteed to catch everything. Review and tweak before running. Reboot after running. Scripts for reversing are included and commented. Fork of https://github.com/Disassembler0/Win10-Initial-Setup-Script (different defaults). N.…
###
###
### UPDATE: For Win 11, I recommend using this tool in place of this script:
### https://christitus.com/windows-tool/
### https://github.com/ChrisTitusTech/winutil
### https://www.youtube.com/watch?v=6UQZ5oQg8XA
### iwr -useb https://christitus.com/win | iex
###
###
@spivurno
spivurno / gw-gravity-forms-advanced-conditional-logic.php
Last active March 5, 2024 11:32
Gravity Wiz // Gravity Forms // Advanced Conditional Logic
<?php
/**
* Gravity Wiz // Gravity Forms // Advanced Conditional Logic
*
* PLEASE NOTE: This snippet is a proof-of-concept. It is not supported and we have no plans to improve it.
*
* Allows multiple groups of conditional logic per field.
*
* @version 0.1
* @author David Smith <david@gravitywiz.com>
@blha303
blha303 / portopen.php
Created January 28, 2017 11:50
A script to check if a given port is open on the connecting host. IP ranges included are for cloudflare, replace with an array containing your proxy server IP ranges
<?php
// A script to check if a given port is open on the connecting host.
// IP ranges included are for cloudflare, replace with an array containing your proxy server IP ranges
// https://b303.me/portopen.php?port=80
header("Content-Type: application/json");
header("Access-Control-Allow-Origin: *");
function cidr_match($ip, $ranges) {
$out = array();
foreach ($ranges as $range) {
list ($subnet, $bits) = explode('/', $range);
@spivurno
spivurno / gp-read-only-disable-for-admins.php
Last active April 10, 2021 22:46
Gravity Perks // GP Read Only // Disable Read Only for Admins
<?php
/**
* Gravity Perks // GP Read Only // Disable Read Only for Admins
* http://gravitywiz.com/
*/
add_filter( 'gform_pre_render', function( $form ) {
foreach( $form['fields'] as $field ) {
if( gw_has_css_class( $field, 'gp-read-only-except-admin' ) && current_user_can( 'administrator' ) ) {
$field->gwreadonly_enable = false;
}