Skip to content

Instantly share code, notes, and snippets.

View JamesHusband's full-sized avatar
:octocat:

James Husband JamesHusband

:octocat:
View GitHub Profile
@JamesHusband
JamesHusband / gist:47a393706992397e9852157f08089b4b
Created December 19, 2016 12:05
Slots - Additional Methods
/Library/WebServer/Documents/superfreeslotgames.com/_assets/includes/scripts.php:
9 <?php // ------------- FORM VALIDATION ?>
10 <script type="text/javascript" src="/resources/js/current/validation/jquery.validate.min.js"></script>
11: <script type="text/javascript" src="/resources/js/current/validation/additional-methods.js"></script>
12 <link href="/resources/_validation/validate-styles.css" rel="stylesheet">
13
/Library/WebServer/Documents/superfreeslotgames.com/_assets/lp/includes/scripts.php:
9 <?php // ------------- FORM VALIDATION ?>
10 <script type="text/javascript" src="https://www.superfreeslotgames.com/resources/js/current/validation/jquery.validate.min.js"></script>
Searching 28748 files for "additional-methods"
/Library/WebServer/Documents/superfreebingo.com/creatives/lp/includes/lp_scripts.php:
1
2 <script src="https://ajax.aspnetcdn.com/ajax/jquery.validate/1.15.0/jquery.validate.min.js"></script>
3: <script src="https://ajax.aspnetcdn.com/ajax/jquery.validate/1.15.0/additional-methods.js"></script>
4 <script>
5
/Library/WebServer/Documents/superfreebingo.com/creatives/old_lp/lp_£35_bonus.php:
@JamesHusband
JamesHusband / gist:96c5f583876d64e034341a56a42a2837
Created December 19, 2016 16:04
Function for adding ASYNC tag to JS Scripts
// Async load
function add_async_to_scripts($url)
{
if (strpos($url, '#asyncload') === false )
return $url;
else if (is_admin())
return str_replace( '#asyncload', '', $url );
else
return str_replace( '#asyncload', '', $url )."' async='async";
}
<script type='text/javascript' src='https://code.jquery.com/jquery-1.12.4.min.js'></script>
<script type='text/javascript' src='https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js' async></script>
<script type='text/javascript' src='https://www.superfreebingo.com/mobile/wp-content/themes/mobilebingo/library/js/libs/slick.min.js' async></script>
<script type='text/javascript' src='https://www.superfreebingo.com/mobile/wp-content/themes/mobilebingo/library/js/libs/addtohome.js' async></script>
<script type='text/javascript' src='//cdnjs.cloudflare.com/ajax/libs/jQuery.mmenu/5.3.4/js/jquery.mmenu.min.js' async></script>
<script type='text/javascript' src='//cdnjs.cloudflare.com/ajax/libs/jquery.colorbox/1.6.3/jquery.colorbox-min.js' async></script>
<script type='text/javascript' src='https://cdnjs.cloudflare.com/ajax/libs/jquery-cookie/1.4.1/jquery.cookie.min.js' async></script>
<script type='text/javascript' src='https://ajax.aspnetcdn.com/ajax/jquery.validate/1.15.0/jquery.validate.min.js' asyn
function lsmwp_post_limter($ids, $in, $count) {
$i = rand(1,$count);
if ($i <= $in) {
return($ids);
}
}
$limit_posts_2_5 = array('28741', '29811');
$limit_posts_1_3 = array('111');
@JamesHusband
JamesHusband / gist:f34512568d82f6c0de9892e1ff9c73cb
Created February 7, 2017 12:06
breaks on live works on staging
function lsmwp_post_limter($ids, $in, $count) {
$i = rand(1,$count);
if ($i <= $in) {
return($ids);
}
else
return false;
}
function lsmWpfilter($posts){
$result = [];
<IfModule mod_expires.c>
# Enable expirations
ExpiresActive On
# Default directive
ExpiresDefault "access plus 1 month"
# My favicon
ExpiresByType image/x-icon "access plus 1 year"
# Images
onSortTableSuccess(sortOrder) {
let sortDirection = this.state.sortDirection;
let chars = this.state.characters;
if (sortDirection == 'asc') {
var sortedChars = _.sortBy(chars, function (i) {
if (sortOrder == 'id') {
return i[sortOrder]
} else {
/_| |_\
//|| ||\\
// || || \\
// ||___|| \\
/ | | \ _
/ __| |__ \ /_\
/ .--~ | | ~--. \| |
/.~ __\ | | / ~.| |
.~ `=='\ | | / _.-'. |
/ / \| |/ .-~ _.-'
public function post_type_choose_templates() {
global $post;
$theme = wp_get_theme();
$post_types_templates_directory = $theme->get_stylesheet_directory() . '/landing-page-templates/' . $post->post_type;
$files = self::scandir( $post_types_templates_directory, array( 'php' ) );
$current_page_template = get_post_meta( $post->ID, '_wp_page_template', true );
if ( ! $current_page_template ) {
$current_page_template = 'none';
}