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
//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; | |
}; |
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 | |
--------- |
<?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; |
<?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 ) { |
<?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 |
-- 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 |
# 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\]" |