Skip to content

Instantly share code, notes, and snippets.

View mvaneijgen's full-sized avatar

Mitchel van Eijgen mvaneijgen

View GitHub Profile
@mvaneijgen
mvaneijgen / colors
Last active August 29, 2015 14:07 — forked from twerth/colors
# Make ls use colors
export CLICOLOR=1
alias ls='ls -Fa'
# define colors
C_DEFAULT="\[\033[m\]"
C_WHITE="\[\033[1m\]"
C_BLACK="\[\033[30m\]"
C_RED="\[\033[31m\]"
C_GREEN="\[\033[32m\]"

Contract Killer

The popular open-source contract for web designers and developers by Stuff & Nonsense

  • Originally published: 23/12/2008
  • Revised date: 15/12/2013
  • Original post

Contract Killer

The popular open-source contract for web designers and developers by Stuff & Nonsense

  • Originally published: 23/12/2008
  • Revised date: 15/12/2013
  • Original post

@mvaneijgen
mvaneijgen / Contract Killer 3.md
Last active August 29, 2015 14:16 — forked from malarkey/Contract Killer 3.md
Dutch version (Nederlandse versie)

Contract Killer

The popular open-source contract for web designers and developers by Stuff & Nonsense

  • Originally published: 02/03/2015
  • Revised date: 02/03/2015
  • Original post

-- delete any usermeta specific to the other subsites
delete from wp_usermeta where meta_key regexp '^wp_([0-9]+)_';
-- duplicate the wp_usermeta structure in a working data table,
-- but add a unique index for filtering out duplicates
create table _fix_usermeta like wp_usermeta;
alter table _fix_usermeta add unique(user_id, meta_key);
-- copy the site-specific usermeta, keeping only the last of each duplicate
insert into _fix_usermeta
@mvaneijgen
mvaneijgen / events-conditional-wrappers.php
Created May 1, 2019 13:59 — forked from jo-snips/events-conditional-wrappers.php
The Events Calendar: Basic Conditional Wrappers
<?php
/*-----------------------------------------------------------------------------------*/
/* Conditional Logic to Detect Various Event Related Views/Pages
/*-----------------------------------------------------------------------------------*/
if( tribe_is_month() && !is_tax() ) { // Month View Page
echo 'were on the month view page';
} elseif( tribe_is_month() && is_tax() ) { // Month View Category Page
@mvaneijgen
mvaneijgen / functions.php
Created June 26, 2019 07:25 — forked from rafsuntaskin/functions.php
Tribe events CSV Add extra export columns for WooCommerce customer address
<?php
/**
* Tribe, adding user meta to the attendees csv export
* Source: https://theeventscalendar.com/support/forums/topic/adding-woocommerce-order-notes-to-attendees-export/
*
*
**/
function tribe_export_custom_set_up( $event_id ) {
@mvaneijgen
mvaneijgen / order-by-acf-like-count.php
Created August 12, 2019 08:10 — forked from jasonbahl/order-by-acf-like-count.php
Shows how to add a custom order value to a connection to order by a custom field.
<?php // open PHP
add_filter( 'graphql_PostObjectsConnectionOrderbyEnum_values', function( $values ) {
$values['LIKE_COUNT'] = [
'value' => 'like_count',
'description' => __( 'The number of likes on the post', 'wp-graphql' ),
];
return $values;
@mvaneijgen
mvaneijgen / browser.txt
Created January 22, 2020 12:35 — forked from pankajparashar-zz/browser.txt
One line browser notepad
Version 1
---------
data:text/html, <html contenteditable>
Version 2
---------
data:text/html, <html><head><link href='http://fonts.googleapis.com/css?family=Open+Sans' rel='stylesheet' type='text/css'><style type="text/css"> html { font-family: "Open Sans" } * { -webkit-transition: all linear 1s; }</style><script>window.onload=function(){var e=false;var t=0;setInterval(function(){if(!e){t=Math.round(Math.max(0,t-Math.max(t/3,1)))}var n=(255-t*2).toString(16);document.body.style.backgroundColor="#ff"+n+""+n},1e3);var n=null;document.onkeydown=function(){t=Math.min(128,t+2);e=true;clearTimeout(n);n=setTimeout(function(){e=false},1500)}}</script></head><body contenteditable style="font-size:2rem;line-height:1.4;max-width:60rem;margin:0 auto;padding:4rem;">
Version 3
---------
@mvaneijgen
mvaneijgen / colorSorting.js
Created April 25, 2020 14:33 — forked from afonsograca/colorSorting.js
Color sorting in JavaScript
//Sorting Hex Color:
var scheme = [
"#4C4C4C","#1F2029","#35404E","#282938","#00A0BE","#C67C48","#32CF72", "#4155D1","#B86838","#D81196","#149C92","#786DC4","#DB2C38","#83C057", "#A4A4A4","#55747C","#FFFFFF"
];
var Color = function Color(hexVal) { //define a Color class for the color objects
this.hex = hexVal;
};