Skip to content

Instantly share code, notes, and snippets.

@leanda
leanda / disable-comments.php
Created November 29, 2017 17:44
Disable WordPress Comments Completely
// Disable support for comments and trackbacks in post types
function df_disable_comments_post_types_support() {
$post_types = get_post_types();
foreach ($post_types as $post_type) {
if(post_type_supports($post_type, 'comments')) {
remove_post_type_support($post_type, 'comments');
remove_post_type_support($post_type, 'trackbacks');
}
}
}
@leanda
leanda / sketch.js
Created June 10, 2017 10:37
Circles with modified stroke weight p5
function setup() {
createCanvas(windowWidth, windowHeight);
noFill();
}
function draw() {
background(255);
var count = 0;
for (var x = 50; x <= width-50; x += 50) {
@leanda
leanda / sketch.js
Created June 10, 2017 10:23
Overlapping circles p5
function setup() {
createCanvas(windowWidth, windowHeight);
noFill();
}
function draw() {
background(255);
for (var x = 50; x <= width-50; x += 50) {
for (var y = 50; y <= height-50; y += 50) {
@leanda
leanda / sketch.js
Created June 10, 2017 10:19
Vanishing Point p5
function setup() {
createCanvas(windowWidth, windowHeight);
noFill();
}
function draw() {
background(255);
for (var x = 50; x <= width-50; x += 50) {
for (var y = 50; y <= height-50; y += 50) {
@leanda
leanda / sketch.js
Created June 10, 2017 10:17
Draw x across the screen
function setup() {
createCanvas(windowWidth, windowHeight);
noFill();
}
function draw() {
background(255);
for (var x = 50; x <= width-50; x += 50) {
for (var y = 50; y <= height-50; y += 50) {
@leanda
leanda / sketch.js
Created June 8, 2017 10:33
p5 Nested Loops
function setup() {
createCanvas(600, 600);
}
function draw() {
background(255);
for (var i=25; i<width; i+=100) {
for (var j=25; j<height; j+=100) {
ellipse (i, j, 20, 20);
@leanda
leanda / sketch.js
Created June 8, 2017 10:28
p5 Concentric Circles
function setup() {
createCanvas(600, 600);
}
function draw() {
background(255);
noFill();
for (var i=50; i<600; i+=100) {
ellipse(width/2, height/2, i, i);
@leanda
leanda / sketch.js
Created June 8, 2017 10:08
p5 Repeating line
function setup() {
createCanvas(600, 600);
}
function draw() {
background(100);
for (var i=0; i<width; i+=10) {
line(i, 0, i, height);
}
@leanda
leanda / sketch.js
Created June 8, 2017 10:06
p5.js Gradient
function setup() {
createCanvas(600, 600);
}
function draw() {
background(200);
for (var i=0; i<width; i++) {
stroke(i/width * 255);
line(i, 0, i, height);
@leanda
leanda / disable_price.php
Last active October 1, 2017 15:23
Woocommerce Disable Variable Product Price Range completely #woocommerce
/*
* Disable Variable Product Price Range completely:
*/
add_filter('woocommerce_variable_price_html','custom_from',10);
add_filter('woocommerce_grouped_price_html','custom_from',10);
add_filter('woocommerce_variable_sale_price_html','custom_from',10);
function custom_from($price){
return false;
}