Skip to content

Instantly share code, notes, and snippets.

View lizardking8610's full-sized avatar

Robert lizardking8610

View GitHub Profile
@lizardking8610
lizardking8610 / media-queries.css
Created May 26, 2017 01:00 — forked from hemantajax/media-queries.css
Very useful media queries snippets
/* Smartphones (portrait and landscape) ----------- */
@media only screen
and (min-device-width : 320px)
and (max-device-width : 480px) {
/* Styles */
}
/* Smartphones (landscape) ----------- */
@media only screen
and (min-width : 321px) {
@lizardking8610
lizardking8610 / madewithlove.php
Created May 24, 2017 15:28
add heart to footer (made with love) ioicons
//* Enqueue Ionicons
add_action( 'wp_enqueue_scripts', 'bg_enqueue_ionicons' );
function bg_enqueue_ionicons() {
wp_enqueue_style( 'ionicons', '//code.ionicframework.com/ionicons/2.0.1/css/ionicons.min.css', array(), CHILD_THEME_VERSION );
}
//* Change the footer text
add_filter('genesis_footer_creds_text', 'sp_footer_creds_filter');
function sp_footer_creds_filter( $creds ) {
$creds = '[footer_copyright] &middot; <p class="love">Made and Customized with <i class="icon ion-heart"></i> by Robert McMillin</p>
@lizardking8610
lizardking8610 / functions.php
Created May 23, 2017 07:17 — forked from studiopress/functions.php
Load Google Fonts.
<?php
//* Do NOT include the opening php tag shown above. Copy the code shown below.
//* Enqueue Lato Google font
add_action( 'wp_enqueue_scripts', 'sp_load_google_fonts' );
function sp_load_google_fonts() {
wp_enqueue_style( 'google-font-lato', '//fonts.googleapis.com/css?family=Lato:300,700', array(), CHILD_THEME_VERSION );
}
@lizardking8610
lizardking8610 / color-button.css
Created May 23, 2017 07:11 — forked from studiopress/color-button.css
Colored Content Boxes
/* Color Buttons
------------------------------------------------------------ */
.button-blue,
.button-gray,
.button-green,
.button-purple,
.button-red,
.button-yellow {
color: #fff;
@lizardking8610
lizardking8610 / DynamicQuiz.css
Created May 19, 2017 07:29
JavaScript: Dynamic Quiz
body {
font-family: Open Sans;
}
h1 {
text-align: center;
}
#title {
text-decoration: underline;
@lizardking8610
lizardking8610 / accordion.js
Created May 18, 2017 18:04
jQuery: multiple accordions on 1 wordpress page
jQuery( function($) {
$( "#accordion:nth-child(1n)" ).accordion({
collapsible: true,
active: false,
heightStyle: "content"
});
} );
@lizardking8610
lizardking8610 / example.html
Created May 18, 2017 17:36
CSS: typewriter effect
<div class="typewriter">
<h1>some example text for ya</h1>
</div>
@lizardking8610
lizardking8610 / passwordstrength.js
Created May 18, 2017 17:33
jQuery: password strength for membership sites
$('#pass').keyup(function(e) {
var strongRegex = new RegExp("^(?=.{8,})(?=.*[A-Z])(?=.*[a-z])(?=.*[0-9])(?=.*\\W).*$", "g");
var mediumRegex = new RegExp("^(?=.{7,})(((?=.*[A-Z])(?=.*[a-z]))|((?=.*[A-Z])(?=.*[0-9]))|((?=.*[a-z])(?=.*[0-9]))).*$", "g");
var enoughRegex = new RegExp("(?=.{6,}).*", "g");
if (false == enoughRegex.test($(this).val())) {
$('#passstrength').html('More Characters');
} else if (strongRegex.test($(this).val())) {
$('#passstrength').className = 'ok';
$('#passstrength').html('Strong!');
} else if (mediumRegex.test($(this).val())) {
@lizardking8610
lizardking8610 / partialpagerefresh.js
Created May 18, 2017 17:27
jQuery: partial page refresh
$('#button1').click(function() {
var url = "http:www.your-url.com?ID=" + Math.random(); //create random number
setTimeout(function() {
$("#elementName").load(url+" #elementName>*","");
}, 1000); //wait one second to run function
});
@lizardking8610
lizardking8610 / onpageload.js
Created May 18, 2017 17:25
jQuery: run javascript only after entire page load
$(window).bind("load", function() {
// code here
});