Skip to content

Instantly share code, notes, and snippets.

View jbutko's full-sized avatar

Jozef Butko jbutko

View GitHub Profile
@jbutko
jbutko / gist:5598212
Created May 17, 2013 10:09
jQuery: basic implementation
<script src="http://code.jquery.com/jquery-latest.js"></script>
<script>
$(document).ready(function(){
});
</script>
@jbutko
jbutko / OpenWithSublimeText2.bat
Created May 22, 2013 15:56 — forked from mrchief/LICENSE.md
SUBLIME TEXT: Add "Open with Sublime Text 2" to Windows Explorer Context Menu
@echo off
SET st2Path=C:\Program Files\Sublime Text 2\sublime_text.exe
rem add it for all file types
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 2" /t REG_SZ /v "" /d "Open with Sublime Text 2" /f
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 2" /t REG_EXPAND_SZ /v "Icon" /d "%st2Path%,0" /f
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 2\command" /t REG_SZ /v "" /d "%st2Path% \"%%1\"" /f
rem add it for folders
@reg add "HKEY_CLASSES_ROOT\Folder\shell\Open with Sublime Text 2" /t REG_SZ /v "" /d "Open with Sublime Text 2" /f
@jbutko
jbutko / wp-ie-conditional.php
Created May 26, 2013 11:30 — forked from Pushplaybang/wp-ie-conditional.php
WP, PHP, functions.php: Enqueue HTML5 Shim
// add ie conditional html5 shim to header
function add_ie_html5_shim () {
global $is_IE;
if ($is_IE)
wp_register_script ('html5shim', "http://html5shim.googlecode.com/svn/trunk/html5.js");
wp_enqueue_script ('html5shim');
}
add_action('wp_head', 'add_ie_html5_shim');
@jbutko
jbutko / ie-conditional.php
Last active December 17, 2015 18:19 — forked from stevegrunwell/gist:2140325
PHP, WP, function.php: Conditional style.css register in function.php
<?php
wp_enqueue_style('ie7-fixes', get_bloginfo('template_url') . '/css/ie7.css', false, '', 'screen');
global $wp_styles;
$wp_styles->add_data('ie7-fixes', 'conditional', 'lte IE 7');
?>
alternativa:
@jbutko
jbutko / index.php
Created May 26, 2013 20:52
PHP, WP: Add different class to every nth post (3rd)
<?php if (have_posts()) : ?>
<?php $c = 0;while (have_posts()) : the_post(); $c++;
if( $c == 3) {
$style = 'third';
$c = 0;
}
else $style='';
?>
<div <?php post_class($style) ?> id="post-<?php the_ID(); ?>">
@jbutko
jbutko / do_color_classes.php
Created May 27, 2013 18:40 — forked from rodgerthat/do_color_classes.php
WP, PHP: Add classes for every (nth) element
/************* ADDING CLASSES TO POST_CLASS **************/
// every post has a few uniquely colored elements, rather than rely on CSS nth-magic, and to keep things smooth
// and not conflict w/ trying to use jQuery nth-magic in tandem w/ the endless scroll,
// the option is to get the server to do the heavy lifting,
// ideally it would be nice to pass the array of classes to iterate thru into the filter,
/**
*
* @param $classes
* @return array
@jbutko
jbutko / The real HTML5 boilerplate.html
Created May 29, 2013 16:15
HTML, HTML5, Boilerplate: The real HTML5 boilerplate
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>HTML5 boilerplate—all you really need…</title>
<link rel="stylesheet" type="text/css" href="css/style.css" />
<!--[if IE]>
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
</head>
@jbutko
jbutko / cmd
Created June 3, 2013 13:45
SASS: Installing SASS
/* Start cmd */
cd.. /*az na C: */
cd ruby200 /* alebo na adresar kde je nainstalovane ruby DL: http://rubyinstaller.org/ */
cd bin
gem install sass
gem install compass
/* ak treba, pridat pred prikazy sudo */
@jbutko
jbutko / scripts.php
Created June 28, 2013 16:29 — forked from billrobbins/scripts.php
WP, function.php: Register & Enqueue scripts and styles
<?php
// Scripting
// Register various scripts
function organizedthemes_script_register() {
if( !is_admin()){
wp_register_script('vids', get_template_directory_uri() . '/js/fitvids.js', array('jquery'), NULL, true );
wp_register_script('flex', get_template_directory_uri() . '/js/flexslider.js', array('jquery'), NULL, true );
wp_register_script('nanoscroller', get_template_directory_uri() . '/js/nanoscroller.js', array('jquery'), NULL, true );
@jbutko
jbutko / script.js
Created July 22, 2013 07:34
jQuery: Animate in angle
// You can specify both left and top property:
$(this).animate({left: '+=30px', top: '+=30px'}, 1000);
// In this case, the angle would be 45°.