Skip to content

Instantly share code, notes, and snippets.

View DLMousey's full-sized avatar
🚀
Neat, busy statuses are yellow

Mousey DLMousey

🚀
Neat, busy statuses are yellow
View GitHub Profile

Keybase proof

I hereby claim:

  • I am dlmousey on github.
  • I am dlmousey (https://keybase.io/dlmousey) on keybase.
  • I have a public key ASDeBITkKuVF1I8H9zH3FLJvxwYYjEetuyFzH4w5rUOtHwo

To claim this, I am signing this object:

@DLMousey
DLMousey / README.md
Last active July 30, 2020 15:45
Wordpress autoloading

Yes i know Composer is a thing,

Yes i know it's autoloader is freaking amazing,

Yes i'm well aware it would be much simpler to use the composer autoloader.

However, If you're submitting your plugin/theme to wordpress.org for review they get a bit uppity about using composer's autoloader sometimes.

It's also worth keeping in mind that not everyone running wp has shell access for interacting with composer.

@DLMousey
DLMousey / README.md
Last active May 31, 2018 09:22
Wordpress Plugin Gulp + Browsersync Setup

Running a Gulp/Browsersync setup for a wordpress plugin is a bit fiddlier than it would be in a half decent different environment, But it can still be done with a bit of additional config.

  • Firstly install Gulp, Gulp PHP Connect plugin and browserSync;
npm install gulp gulp-connect-php browser-sync
  • Create a gulpfile.js at the root of your project, Assuming you are at the root of the wordpress installation;
@DLMousey
DLMousey / FizzBuzz.js
Created July 31, 2017 23:49
My attempt at the classic FizzBuzz interview question
/**
* @author Tom "DLMousey" <tom@llamatorials.com> (@DLMousey)
*/
/**
* Array of objects used as input for the calcualteFizzBuzz method.
* Interviewer wants it to work with 7s? Don't even bother modifying
* the code just add it here!
*/
var input = [
@DLMousey
DLMousey / snippets.md
Last active March 21, 2017 10:37
Useful Regex Snippets

General use method

In sublime & VS Code when you enter find and replace (CTRL + H on windows, I think CMD + H on mac?) there's a toggle switch with .* on it, This will enable regex searching which when enabled, Will allow you to use these snippets

HTML Comment Removal

Remove erronous comments that prevent you from commenting out a block of HTML code. For instance a block like this would prevent you from commenting out anything after it because the existing comment will interrupt the new comment tags that will surround the content;

    <div class="foo">
        <li class="bar">Baz</li>
 
@DLMousey
DLMousey / RetrieveForecastTask.java
Last active June 17, 2016 20:53
Missing RetrieveForecastTask.java class for the Complete Android M Dev Bundle on StackSkills, With additional comments
package com.tmlov.androidweather;
import android.os.AsyncTask;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import java.io.BufferedReader;
import java.io.IOException;
@DLMousey
DLMousey / Converter.java
Last active June 7, 2016 19:42
Converter.java class file from the Stackskills complete Android Marshmallow series since Mohitd didn't provide it!
// CHANGE THIS TO YOUR PACKAGE NAME!
package com.tmlov.unitconverter;
public class Converter {
public enum Unit {
INCH,
CENTIMETER,
FOOT,
YARD,
METER,
@DLMousey
DLMousey / Basic Bootstrap Index.html
Created January 29, 2016 23:26
A quick walkthrough of how basic bootstrap stuff works for Arctica
<!DOCTYPE html>
<head>
<!-- Grab the Bootstrap CSS Library -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
<!-- Grab the Bootstrap Javascript Library (not actually required here) -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
</head>
<!-- End the clever bit -->