Skip to content

Instantly share code, notes, and snippets.

View seb86's full-sized avatar
🚀

Sébastien Dumont seb86

🚀
View GitHub Profile
@seb86
seb86 / woocommerce-notes-testing.php
Created September 7, 2020 14:10 — forked from octaedro/woocommerce-notes-testing.php
Adds 3 new notes with layout: banner, thumbnail, and plain, OR sets all the notes to not deleted.
<?php
/**
* Plugin Name: WooCommerce Prepare Notes Testing
* Plugin URI: https://woocommerce.com
* Description: Adds 3 new notes with layout: banner, thumbnail, and plain, OR sets all the notes to not deleted.
* Author: WooCommerce
* Domain Path: /test_notes
* Version: 0.1
*/
/* dragging logic for nomadlist.com/dating */
/* by @levelsio */
/* MIT license */
/* <dragging logic> */
$('body').on('mousedown touchstart','.card',function(e) {
if(!currentCardUserId) return;
if($('card.match_card').is(':visible')) return;
if(typeof e.originalEvent.touches !=='undefined') {
/* touch device */
<?
/////////////////////
// slack2html
// by @levelsio
/////////////////////
//
/////////////////////
// WHAT DOES THIS DO?
/////////////////////
//
@seb86
seb86 / slack-theme.txt
Created April 27, 2020 15:26
CoCart Slack Theme Palette
#6E60CC,#F0F0F0,#9A6FC4,#FFFFFF,#9A6FC4,#FEFEFE,#83C46F,#CD2553,#6E60CC,#FFFFFF
@seb86
seb86 / wcs-contract-subscription.php
Last active April 25, 2020 11:38
Disables certain action buttons for weekly subscriptions and subscriptions with a free trial. Weekly subscriptions can not be cancelled for at least a year.
<?php
/*
* Plugin Name: WooCommerce Subscriptions - Contract Subscriptions
* Description: Disables certain action buttons for weekly subscriptions and subscriptions with a free trial. Weekly subscriptions can not be cancelled for at least a year.
* Author: Sébastien Dumont
* Author URI: https://sebastiendumont.com
* Version: 0.0.2
*
* License: GNU General Public License v3.0
* License URI: http://www.gnu.org/licenses/gpl-3.0.html
@seb86
seb86 / alnp-filter-template-location.php
Created January 21, 2019 21:38
This filters the template location for Auto Load Next Post according to your themes template location.
<?php
function my_template_location() {
return 'templates/';
}
add_filter( 'alnp_template_location', 'my_template_location' );
@seb86
seb86 / Dynamic_Load_On_Scroll_Jquery.html
Created July 6, 2018 19:18 — forked from sphingu/Dynamic_Load_On_Scroll_Jquery.html
Loading content on scroll to bottom on page using Jquery
<html>
<head>
<title>Scroll to bottom Detection</title>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript">
var count=0;
$(document).ready(function(){
SetValues();
$(window).scroll(function(){
//Will check if the user has reached bottom of a PAGE
@seb86
seb86 / wpforms-gdpr-request-form.json
Created May 20, 2018 21:31
GDPR Data Request Form - Replace {{Company Name}} with the name of your company before importing into WPForms.
[{"id":"633128","field_id":"13","fields":{"3":{"id":"3","type":"select","label":"Are you a person or an organisation?","choices":{"1":{"default":"1","label":"I'm a Person","value":"","image":""},"2":{"label":"I'm Representing an Organisation","value":"","image":""}},"description":"","required":"1","size":"large","placeholder":"","css":"","dynamic_choices":""},"0":{"id":"0","type":"name","label":"What's your name?","format":"simple","description":"","required":"1","size":"large","simple_placeholder":"","simple_default":"","first_placeholder":"","first_default":"","middle_placeholder":"","middle_default":"","last_placeholder":"","last_default":"","css":""},"11":{"id":"11","type":"text","label":"What's your organisation's name?","description":"","required":"1","size":"medium","placeholder":"","default_value":"","css":"","input_mask":"","conditional_logic":"1","conditional_type":"show","conditionals":[[{"field":"3","operator":"==","value":"2"}]]},"12":{"id":"12","type":"text","label":"VAT number for your organisa
@seb86
seb86 / jquery-scroll-bottom.js
Created April 23, 2018 22:36 — forked from toshimaru/jquery-scroll-bottom.js
Detect the scrolling to bottom of the page using jQuery.
$(window).on("scroll", function() {
var scrollHeight = $(document).height();
var scrollPosition = $(window).height() + $(window).scrollTop();
if ((scrollHeight - scrollPosition) / scrollHeight === 0) {
// when scroll to bottom of the page
}
});
@seb86
seb86 / content-alnp.php
Last active November 24, 2018 18:49
Auto Load Next Post template
<?php
/**
* The Template for displaying a post when called.
*
* This template can be overridden by copying it to yourtheme/auto-load-next-post/content-alnp.php.
*
* HOWEVER, on occasion Auto Load Next Post will need to update template files and you
* (the theme developer) will need to copy the new files to your theme to
* maintain compatibility. I try to do this as little as possible, but it does
* happen. When this occurs the version of the template file will be bumped and