Skip to content

Instantly share code, notes, and snippets.

View vanbernaert's full-sized avatar

Kristof Bernaert vanbernaert

  • VAN BERNAERT
  • Europe
View GitHub Profile
<?php
//
// delete-old-tweets.php - https://github.com/timdp
//
// -- Instructions --
// 1. Save this script somewhere as delete-old-tweets.php
// 2. Get your Twitter archive and extract it to the same folder
// 3. Clone https://github.com/themattharris/tmhOAuth to the same folder
// 4. Register an app at dev.twitter.com and enter its credentials below
@vanbernaert
vanbernaert / .gitignore
Created May 2, 2020 22:18 — forked from lumpysimon/.gitignore
A .gitignore file for WordPress that ignores pretty much everything except for the specified plugin(s), theme(s) and mu-plugins folder
# .gitignore file for WordPress that ignores everything except:
#
# - .gitignore
# - favicon.ico
# - wp-config.php
# - everything in mu-plugins
# - my-plugin
# - my-theme (except for .sass-cache)
#
# based on https://gist.github.com/jdbartlett/444295
@vanbernaert
vanbernaert / functions.php
Last active April 11, 2018 12:16
WordPress Shortcode function to use URL QueryString value
function URLPARAM( $att01 ) {
extract( shortcode_atts( array(
'var' => 'var',
), $att01 ) );
if (isset($_GET[$var])) {
return $_GET[$var];
}
}
# http://www.gravityhelp.com/documentation/page/Web_API#Security
import time
import base64
import urllib
import requests
import json
import hmac
from hashlib import sha1
@vanbernaert
vanbernaert / function.php
Created December 13, 2017 11:00
Keep WordPress Post Date & Time on current time
wp_update_post(
array (
'ID' => 101, // ID of the post to update
'post_date' => $time,
'post_date_gmt' => get_gmt_from_date( $time )
)
);

Keybase proof

I hereby claim:

  • I am ssstofff on github.
  • I am ssstofff (https://keybase.io/ssstofff) on keybase.
  • I have a public key whose fingerprint is 0DBC AFA6 A1E4 D00C 87A3 C0D1 B494 4EBC 5BD7 02E0

To claim this, I am signing this object:

@vanbernaert
vanbernaert / gist:710939144018a44a9c25bb1f613b1dea
Last active December 17, 2018 11:49
WordPress: List subpages on a parent page through a shortcode
function wpb_list_child_pages() {
global $post;
if ( is_page() && $post->post_parent )
$childpages = wp_list_pages( 'sort_column=menu_order&title_li=&child_of=' . $post->post_parent . '&echo=0' );
else
$childpages = wp_list_pages( 'sort_column=menu_order&title_li=&child_of=' . $post->ID . '&echo=0' );
@vanbernaert
vanbernaert / style.css
Last active December 5, 2017 07:37
GenesisWP most simple child theme
/*
Theme Name: Genesis Child Theme
Theme URI: http://link-to-page-with-theme-exaplanation
Description: Designed by <a href="https://kristofbernaert.be">Kristof Bernaert</a>.
Author: Kristof Bernaert
Version: 0.1
Template: genesis
Tags: the child of genesis
*/
@vanbernaert
vanbernaert / WP-exclude-from-search
Last active January 17, 2016 20:13
Exclude a (Custom) Post Type from WordPress Search Result
@vanbernaert
vanbernaert / functions.php
Created November 12, 2015 22:07 — forked from wpspeak/functions.php
Add Estimated Post Reading Time in Genesis Framework
<?php
//* Add Estimated Post Reading Time in Genesis Framework using Estimated Post Reading Time plugin
add_filter( 'genesis_post_info', 'afn_post_info_filter' );
function afn_post_info_filter($post_info) {
$post_info = '[post_date] by [post_author_posts_link] [post_comments] [post_edit] Estimated reading time: [est_time]';
return $post_info;
}