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 / 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)
@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 / 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 / woocommerce-custom-cart-item-data.php
Created January 29, 2017 15:45 — forked from RadGH/woocommerce-custom-cart-item-data.php
Get and set custom cart item/product information prior to WooCommerce checkout, and carry those valus over to Order Item Metadata.
<?php
/*
Instructions:
1) Save data when adding to cart
When adding an item to your cart, use ld_woo_set_item_data. The best action for this to occur is
"woocommerce_add_to_cart". The first parameter for this action contains the "cart_item_key",
which is required for the function.
@the-nerdery-dot-info
the-nerdery-dot-info / woocommerce-ajax.php
Created January 29, 2017 15:37 — forked from qutek/woocommerce-ajax.php
[Wordpress] [Woocommerce] WooCommerce Ajax Handlers
<?php
/**
* WooCommerce Ajax Handlers
*
* Handles AJAX requests via wp_ajax hook (both admin and front-end events)
*/
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
/** Frontend AJAX events **************************************************/
@the-nerdery-dot-info
the-nerdery-dot-info / mkWindow.py
Created December 22, 2016 05:44 — forked from atvKumar/mkWindow.py
Boiler Plate Code for Windows GUI under PyMel/Python/Maya
#-------------------------------------------------------------------------------
# Boiler Plate Code for Windows
# By : Kumaran
import pymel.core as pm
class UI(pm.uitypes.Window):
_TITLE = "mkWindow"
_LAYOUT = "mkLayout"
_DOCKCONTROL = "mkDockCtrl"
@the-nerdery-dot-info
the-nerdery-dot-info / .bash_aliases-ubuntu
Created December 15, 2016 02:31 — forked from nitriques/.bash_aliases-ubuntu
My .bash_profile files. OS X, Windows (git bash) and Linux (Ubuntu/Cent OS)
alias l='ls -CF'
alias home='cd ~/'
alias apt-get='aptget'
alias egrep='egrep --color=auto'
alias fgrep='fgrep --color=auto'
alias grep='grep --color=auto'
alias o='nautilus .'
alias c='xdg-open'
@the-nerdery-dot-info
the-nerdery-dot-info / 000-Cheat-Sheets.md
Created December 14, 2016 23:27 — forked from JoshuaEstes/000-Cheat-Sheets.md
Developer Cheat Sheets for bash, git, gpg, irssi, mutt, tmux, and vim. See my dotfiles repository for extra info.
@the-nerdery-dot-info
the-nerdery-dot-info / a_readme.md
Created November 10, 2016 01:33 — forked from SplittyDev/a_readme.md
x86 bare metal protected mode itoa implementation

Freestanding x86 itoa implementation

For use in OS development.
Designed to be assembled with NASM, porting it over to other assemblers should be easy.

License

You are free to use, modify, distribute and sell this code.
A small message referring to this gist would be nice, though not required.

Important

This implementation uses a custom calling convention.