Skip to content

Instantly share code, notes, and snippets.

View jbutko's full-sized avatar

Jozef Butko jbutko

View GitHub Profile
@jbutko
jbutko / gist:6065493
Created July 23, 2013 19:39 — forked from markdcraftww/gist:5662315
WP, function.php: Register, Deregister & Enqueue scripts short
if (!is_admin()) add_action( 'wp_enqueue_scripts', 'my_jquery_enqueue', 11 );
function my_jquery_enqueue() {
wp_deregister_script( 'jquery' );
wp_register_script( 'jquery', get_template_directory_uri() . '/js/jquery.js', false, null );
wp_enqueue_script( 'jquery' );
}
@jbutko
jbutko / style.css
Created July 24, 2013 20:26
HTML, Responsive, IE: Responsive images
img {
max-width: 100%;
height: auto;
}
/* conditionaly add support for IE 6 and IE 7
width: 100%
*/
@jbutko
jbutko / style.scss
Created July 28, 2013 20:01
SASS, SCSS, mixin: PX to EM conversion
/* PX to EM conversion
example: font-size: em(30);
*/
@function em($target, $context: 16) {
@return ($target / $context) * 1em;
}
/* Media queries for iPhone 3+4 portrait & iPhone 5 portrait */
@media only screen and (min-device-width:241px) and (max-device-width:320px) {
}
/* Media queries for Android (Samsung Galaxy) portrait */
@media only screen and (min-device-width:321px) and (max-device-width:380px) {
}
@jbutko
jbutko / header.php
Created July 30, 2013 19:07
WP, PHP: Title tag
<title><?php bloginfo('name'); ?> &raquo; <?php is_front_page() ? bloginfo('description') : wp_title(''); ?></title>
@jbutko
jbutko / index.html
Created July 30, 2013 21:10
HTML, Flash: No flash message, download flash
<div id="noFlash">
<p>To experience our Strong application, you will need to download Flash 10.</p>
<a class='hdr hdr-download_flash' href='http://get.adobe.com/flashplayer'>Download Flash 10</a>
</div>
// or
<div id="containerId">
<a href="http://www.adobe.com/go/getflashplayer">
<img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" />
@jbutko
jbutko / style.css
Created August 5, 2013 20:13
CSS, mediaQueries: 960grid mediaQueries
/*********************
MEDIA QUERIES
*********************/
@media screen and (min-width: 100px) and (max-width: 760px) {
.grid_1,.grid_2,.grid_3,.grid_4,.grid_5,.grid_6,.grid_7,.grid_8,.grid_9,.grid_10,.grid_11,.grid_12{margin-left:10px;margin-right:10px}.alpha,.omega{margin-left:0;margin-right:0}.align_center,.align_right{text-align:left}
.footer-right ul {
margin: 0;
}
@jbutko
jbutko / index.php
Created August 12, 2013 08:39
WP, PHP: Adding a Branded Image as the Default Fallback
<?php if ( has_post_thumbnail() ) {
the_post_thumbnail();
} else { ?>
<img src="<?php bloginfo('template_directory'); ?>/images/default-image.jpg" alt="<?php the_title(); ?>" />
<?php } ?>
@jbutko
jbutko / script.js
Created August 12, 2013 11:26
jQuery: smooth scroll to desired #element
//HTML MARKUP
<a href="#services">Jump to services</a>
<div id="services">
</div>
//jQuery
@jbutko
jbutko / style.css
Created August 17, 2013 20:18
CSS, CCS3, HTML: Anchor tags a hover transitions effect
a, a > * {
transition: color 0.4s ease 0s, background-color 0.4s ease 0s, border 0.4s ease 0s, opacity 0.4s ease-in-out 0s;
}