Skip to content

Instantly share code, notes, and snippets.

View the-nerdery-dot-info's full-sized avatar

Michael Morrissey the-nerdery-dot-info

View GitHub Profile
@the-nerdery-dot-info
the-nerdery-dot-info / gist:ea6291e64b0d5f10fd1217892f3506f0
Created June 9, 2017 00:22 — forked from mikejolley/gist:6713608
WooCommerce Shipping Method Skeleton Plugin
<?php
/*
Plugin Name: Your Shipping plugin
Plugin URI: http://woothemes.com/woocommerce
Description: Your shipping method plugin
Version: 1.0.0
Author: WooThemes
Author URI: http://woothemes.com
*/
@the-nerdery-dot-info
the-nerdery-dot-info / storefront-full-width-slider.php
Created June 24, 2017 00:43 — forked from mikeyarce/storefront-full-width-slider.php
Add a full-width slider to Storefront (meta slider in example)
// Don't copy this opening PHP tag if your file already has one. That breaks things.
<?php
function marce_slider_before_storefront_content () {
// If the template is not the homepage (template-homepage.php), don't display.
if ( ! is_page_template( 'template-homepage.php' ) ) {
return false;
}
// If it is the homepage, add this meta slider shortcode
echo do_shortcode( '[metaslider id=586]');
@the-nerdery-dot-info
the-nerdery-dot-info / rust_md5.md
Created October 23, 2017 19:29 — forked from gkbrk/rust_md5.md
Rust MD5 [AdventOfCode]

Is Rust's MD5 Slow? Heck no!

Today I came across this post on the Rust subreddit. Basically it is comparing two MD5 Miners written in Python and Rust. The miner is written for a code challenge called Advent of Code.

To be honest, speed is one of the things I love about Rust, so seeing Rust being blown away by Python (which I also like and use a lot) made me sad. I decided to make this a bit more fair for Rust so I made a very short piece of Rust code to complete this challenge FAST.

The challenge

The challenge, as written on the Advent of Code page is as follows:

  • You are given a key, for example abcdef.
  • You are looking for a string that is made by taking the MD5 of this key plus a number. This hash has to start with 5 leading zeros. (Like abcdef609043)