Skip to content

Instantly share code, notes, and snippets.

Jay Versluis versluis

Block or report user

Report or block versluis

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
@versluis
versluis / yum history undo
Created Jul 12, 2019
yum history undo - Dependencies Resolved
View yum history undo
Dependencies Resolved
================================================================================
Package Arch Version Repository Size
================================================================================
Installing:
php-mysql i686 5.4.45-56.el6.art atomic 461 k
Removing:
gd-last i686 2.2.5-5.el6.remi @remi-safe 372 k
libargon2 i686 20161029-7.el6.remi @remi-safe 58 k
View yum history
yum history
Loaded plugins: fastestmirror, refresh-packagekit
ID | Login user | Date and time | Action(s) | Altered
-------------------------------------------------------------------------------
86 | root <root> | 2019-07-12 11:13 | I, O, U | 11 EE
85 | root <root> | 2019-07-12 11:09 | Install | 1
84 | root <root> | 2019-07-12 10:43 | E, I, U | 19 EE
83 | root <root> | 2019-05-06 08:59 | E, I, U | 27 EE
82 | root <root> | 2018-12-19 22:41 | Update | 2
@versluis
versluis / functions.php
Created May 23, 2019
generated by Child Theme Wizard 1.4
View functions.php
function your_theme_enqueue_styles() {
$parent_style = 'parent-style';
wp_enqueue_style( $parent_style,
get_template_directory_uri() . '/style.css');
wp_enqueue_style( 'child-style',
get_stylesheet_directory_uri() . '/style.css',
array($parent_style),
@versluis
versluis / vanish.html
Last active Apr 10, 2019
Make empty links disappear from the DOM
View vanish.html
<p class="one"><a href=''>This line shall vanish.</a></p>
<p class="one"><a href='https://versluis.com'>This line shall prevail.</a></p>
<p>The End.</p>
<script>
// make empty links vanish
$('.one a').each(function() {
if(!$(this).attr('href')) {
$(this).parent().hide();
@versluis
versluis / isThisInThat.php
Created Mar 19, 2019
helper function to test if a string is contained in another string
View isThisInThat.php
function isThisInThat ($needle, $haystack) {
return strpos($haystack, $needle) !==false;
}
@versluis
versluis / input.bas
Created May 4, 2018
a text input routine written in Commodore BASIC
View input.bas
5 print
10 w$=""
20 print "(greater than)_";
30 get a$:if a$="" then 30
40 a=asc(a$)
50 if a=13 then 200:rem return
60 if a=32 then 110:rem space
70 if a=20 then 300:rem backspace
100 if a<65 or a>90 then 30
110 print chr$(20);a$;"D";
@versluis
versluis / wp-comment-wordcount1.php
Created Mar 25, 2018
get word count from comments written by the current user in WordPress
View wp-comment-wordcount1.php
function getWordCountCommentsCurrentUser() {
$count = 0;
$user_id = get_current_user_id();
$comments = get_comments( array(
'user_id' => $user_id
));
foreach( $comments as $comment ) {
$count += str_word_count( $comment->comment_content );
}
@versluis
versluis / wp-wordcount.php
Created Mar 25, 2018
get total word count from all posts in WordPress
View wp-wordcount.php
function getWordCountFromPosts () {
$count = 0;
$posts = get_posts( array(
'numberposts' => -1,
'post_type' => 'any'
));
foreach( $posts as $post ) {
$count += str_word_count( strip_tags( get_post_field( 'post_content', $post->ID )));
@versluis
versluis / clock.prg
Created Mar 23, 2018
Creates a simple clock in Commodore BASIC
View clock.prg
5 input "qwhat is the current time (hhmm
ss) ";ti$
10 print chr$(147):print chr$(5)
20 a$ = left$(ti$,2)
25 a$ = a$ +":"
30 a$ = a$ + mid$(ti$,3,2)
35 a$ = a$ +":"
40 a$ = a$ +right$(ti$,2)
50 gosub 200
60 print chr$(19)
You can’t perform that action at this time.