Skip to content

Instantly share code, notes, and snippets.

View mrl22's full-sized avatar
💭
Always coding

Richard Leishman mrl22

💭
Always coding
View GitHub Profile
@mrl22
mrl22 / user-create.php
Created October 30, 2017 12:51 — forked from brendonexus/user-create.php
Create WP User from file
<?php
//Put this file in the root and run from browser or command line to generate the user
require 'wp-load.php';
global $wpdb;
$prefix = $wpdb->prefix;
//Fill in all variables below
$name = '';
function your_custom_pagination() {
global $wp_query;
$total = $wp_query->max_num_pages;
if ( $total > 1 ) {
if ( !$current_page = get_query_var('paged') ) {
$current_page = 1;
}
echo paginate_links(array(
'base' => get_pagenum_link(1) . '%_%',
'format' => '?paged=%#%',
@mrl22
mrl22 / functions.php
Created April 6, 2017 11:15 — forked from brendonexus/Wordpress current template hook
Wordpress current template hook
add_action('get_footer', 'show_template');
function show_template()
{
global $template;
if ($_SERVER['REMOTE_ADDR'] == 'ip_address') echo basename($template);
}
@mrl22
mrl22 / gist:866408b446ce91ba483c954ac69cd383
Last active October 31, 2019 23:20 — forked from brendonexus/Bootstrap 4 Visible Style
Bootstrap 4 Visible Style
<div class="d-block d-sm-none">
visible XS
</div>
<div class="d-none d-sm-block d-md-none">
visible SM
</div>
<div class="d-none d-md-block d-lg-none">
visible MD
</div>
<div class="d-none d-lg-block d-xl-none">
@mrl22
mrl22 / font-smoothing.css
Last active December 16, 2016 12:57 — forked from bearroast/gist:3880174
Font smoothing
body {
-webkit-font-smoothing: antialiased;
-moz-font-smoothing: antialiased;
font-smoothing: antialiased;
text-rendering: optimizeLegibility;
-webkit-text-size-adjust: 100%;
}
@mrl22
mrl22 / nginx.conf
Created July 5, 2016 13:18 — forked from plentz/nginx.conf
Best nginx configuration for improved security(and performance). Complete blog post here http://tautt.com/best-nginx-configuration-for-security/
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@mrl22
mrl22 / .htaccess
Last active August 29, 2015 14:17 — forked from sanusart/.htaccess
RewriteEngine on
RewriteRule .*\.git/.* - [F]