Skip to content

Instantly share code, notes, and snippets.

🏠
Working from home

Aristeides Stathopoulos aristath

🏠
Working from home
Block or report user

Report or block aristath

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@aristath
aristath / poop.js
Last active Sep 10, 2019
jQuery replacement for WordPress themes. Contains the most widely-used functions.
View poop.js
/**
* Find an element.
*
* @param {string|Object} selector - The css selector of the element.
* If object then it can either be document or an element.
* @param {Object} parent - The parent element, or undefined for document.
* @return {Object} - returns the _lm object to allow chaining methods.
*/
var _lm = function( selector, parent ) {
parent = parent || document;
@aristath
aristath / helperEl.js
Last active Aug 28, 2019
simple jQuery alternative for common functions, inspired by http://youmightnotneedjquery.com/
View helperEl.js
/* eslint no-unused-vars:off */
var fusionHelperEl = {
/**
* Find an element.
*
* @param {string|Object} selector - The css selector of the element.
* If object then it can either be document or an element.
* @param {Object} parent - The parent element, or undefined for document.
* @return {Object} - returns the fusionHelperEl object to allow chaining methods.
*/
View parent-theme-mod-loader.php
<?php
/**
* Plugin Name: parent-theme-mods-loader
*/
add_action(
'customize_register',
/**
* Hooks in customize_register to load our control, register settings and do what needs to be done.
*
View color-generator.php
<?php
/**
* Requires ariColor: https://aristath.github.io/ariColor/
*/
add_action( 'wp', function() {
if ( ! class_exists( 'ariColor' ) ) {
return;
}
$colors = [];
View Colour.js
var Colour = function( rgba ) {
var rgbaString = '';
if ( 'transparent' === rgba ) {
rgba = [ 0, 0, 0, 0 ];
} else if ( 'string' === typeof rgba ) {
rgbaString = rgba;
rgba = rgbaString.match( /rgba?\(([\d.]+), ([\d.]+), ([\d.]+)(?:, ([\d.]+))?\)/ );
if ( rgba ) {
rgba.shift();
View system-error
Anonymous UUID: DEC44D6A-D5F1-35D4-FC46-A6E021923230
Tue Jul 24 11:20:44 2018
*** Panic Report ***
Machine-check capabilities: 0x0000000000000c0a
family: 6 model: 70 stepping: 1 microcode: 25
signature: 0x40661
Intel(R) Core(TM) i7-4750HQ CPU @ 2.00GHz
10 error-reporting banks
View gist:561f1aef46af4902b3318b1627903419
$wpe_common = WpeCommon::instance();
foreach ( array( 'trashed_post', 'delete_post', 'edit_post', 'publish_page', 'publish_post', 'save_post' ) as $hook ) {
remove_action( $hook, array( $wpe_common, 'purge_varnish_cache' ) );
}
@aristath
aristath / bbpress-gdpr.php
Created May 18, 2018
Removes IP & UA tracking from bbPress
View bbpress-gdpr.php
<?php
add_filter( 'bbp_current_author_ip', function() {
return '127.0.0.1';
} );
add_filter( 'get_post_metadata', function( $metadata, $object_id, $meta_key, $single ) {
if ( isset( $meta_key ) && '_bbp_author_ip' === $meta_key ) {
return '';
View class-gdpr-consent-logger.php
View gist:636f5ad9af81de144f3512d93ab3b786
<?php
/**
* Returns the URL for an option.
* If no option is defined, return all.
*
* @param string $option The key of the item for which we want to get the URL.
* @return string|array Returns string if $option is defined. Returns array if option is false.
*/
function my_cool_theme_get_radiobutton_option( $option = false ) {
You can’t perform that action at this time.