Skip to content

Instantly share code, notes, and snippets.

View seb86's full-sized avatar
🚀

Sébastien Dumont seb86

🚀
View GitHub Profile
@keesiemeijer
keesiemeijer / setup-phpunit.sh
Last active December 8, 2023 11:02
Setup PHPUnit for use in the Local by Flywheel app
#!/usr/bin/env bash
# ===============================================================================
# Script to install PHPUnit in the Local by Flywheel Mac app
# These packages are installed
#
# PHPUnit, curl wget, rsync, git, subversion and composer.
#
# WordPress is installed in the `/tmp/wordpress` directory for use by PHPUnit.
# The WordPress test suite is installed in the `/tmp/wordpress-tests-lib` directory.
#include <Windows.h>
#include "../../API/RainmeterAPI.h"
struct ACCENTPOLICY {
int nAccentState;
int nFlags;
int nColor;
int nAnimationId;
};
struct WINCOMPATTRDATA {
<?
// <readme>
/*
This is a lite version of Olark's and Intercom's functionality (without the chat part).
It lets you get feedback from users on your site to your email.
And you won't have to rely on another company anymore!
#killyourdependencies
@jaredatch
jaredatch / functions.php
Last active October 16, 2023 11:51
WPForms display form entries with a custom shortcode
<?php
/**
* Custom shortcode to display WPForms form entries.
*
* Basic usage: [wpforms_entries_table id="FORMID"].
*
* Possible shortcode attributes:
* id (required) Form ID of which to show entries.
* user User ID, or "current" to default to current logged in user.
* fields Comma seperated list of form field IDs.
@kloon
kloon / fake-emails.php
Last active September 12, 2018 14:07
WooCommerce prohibit account creation with fake emails, ie sharklashers.com
<?php
/**
* Do not allow account creation with temp email addresses
* @param Object $validation_errors
* @param string $username
* @param string $email
* @return WP_Error
*/
function do_not_allow_temp_email_addresses( $validation_errors, $username, $email ) {
$prohibitied_domains = array(
@jessepearson
jessepearson / add_bcc_to_certain_emails.php
Created October 31, 2016 17:19
Add a BCC to certain defined emails sent from WooCommerce
<?php // only copy this line if needed
/**
* Function adds a BCC header to emails that match our array
*
* @param string $headers The default headers being used
* @param string $object The email type/object that is being processed
*/
function add_bcc_to_certain_emails( $headers, $object ) {
@freekrai
freekrai / demo.php
Last active April 21, 2024 00:42
PHP session-based rate limiter for APIs
<?php
date_default_timezone_set('America/Los_Angeles');
session_start();
include("ratelimiter.php");
// in this sample, we are using the originating IP, but you can modify to use API keys, or tokens or what-have-you.
$rateLimiter = new RateLimiter($_SERVER["REMOTE_ADDR"]);
$limit = 100; // number of connections to limit user to per $minutes
$minutes = 1; // number of $minutes to check for.
@thenbrent
thenbrent / wcs-mod-display.php
Created October 5, 2016 00:21
Prepend "With Failure" to subscriptions with the "on-hold" status and the last renewal order with the "failed" status.
<?php
/**
* Plugin Name: WooCommerce Subscriptions - Display Failed Status
* Plugin URI:
* Description: Prepend "With Failure" to subscriptions with the "on-hold" status and the last renewal order with the "failed" status.
* Author: Prospress Inc.
* Author URI: http://prospress.com/
* Version: 1.0
*
* Copyright 2016 Prospress, Inc. (email : freedoms@prospress.com)
<?xml version="1.0" encoding="utf-8"?>
<browserconfig>
<msapplication>
<tile>
<square70x70logo src="/mstile-70x70.png"/>
<square144x144logo src="/mstile-144x144.png"/>
<square150x150logo src="/mstile-150x150.png"/>
<square310x310logo src="/mstile-310x310.png"/>
<wide310x150logo src="/mstile-310x150.png"/>
<TileColor>#132935</TileColor>
@Isaddo
Isaddo / import-github-labels.js
Last active February 9, 2024 22:44
import github labels via console command
/*
Go on your labels page (https://github.com/user/repo/labels)
Edit the following label array
or
Use this snippet to export github labels (https://gist.github.com/MoOx/93c2853fee760f42d97f)
and replace it
Paste this script in your console
Press Enter!!