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 / install_fonts_from_network.ps
Last active November 1, 2017 20:54
Install fonts from network powerscript
#Font Locations
#Network Location
$NetworkPath = \\SERVER\SHARE\Fonts\
#Local Location (temp place to store fonts)
$LocalPath= "C:\Users\Public\Fonts\"
$FONTS = 0x14
$objShell = New-Object -ComObject Shell.Application
$objFolder = $objShell.Namespace($FONTS)
@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 / commit.md
Created October 23, 2017 17:12
Commit Message Conventional Format

Commit Message Format

Each commit message consists of a header, a body and a footer. The header has a special format that includes a type, a scope and a subject:

<type>(<scope>): <subject>
<BLANK LINE>
<body>
@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 / .tmux.conf
Created December 15, 2016 08:27
Tmux Configuration
# Smart pane switching with awareness of Vim splits.
# See: https://github.com/christoomey/vim-tmux-navigator
is_vim="ps -o state= -o comm= -t '#{pane_tty}' \
| grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'"
bind-key -n C-h if-shell "$is_vim" "send-keys C-h" "select-pane -L"
bind-key -n C-j if-shell "$is_vim" "send-keys C-j" "select-pane -D"
bind-key -n C-k if-shell "$is_vim" "send-keys C-k" "select-pane -U"
bind-key -n C-l if-shell "$is_vim" "send-keys C-l" "select-pane -R"
bind-key -n C-\ if-shell "$is_vim" "send-keys C-\\" "select-pane -l"