Skip to content

Instantly share code, notes, and snippets.

View jbutko's full-sized avatar

Jozef Butko jbutko

View GitHub Profile
@jbutko
jbutko / single.php
Created October 1, 2013 16:02
WP, php: Correct Previous/Next link usage
<div class="next_post_link cf"><?php next_post_link('%link', 'Next in category', FALSE); ?></div>
@jbutko
jbutko / scripts.js
Created October 13, 2013 17:45
jQuery, WP: Add class to every third element
// .THIRD CLASS TO EVERY THIRD ARTICLE
var i = 1;
$('article').each(function() {
if(i++ % 3 == 0)
$(this).addClass('third');
});
@jbutko
jbutko / style.css
Created October 18, 2013 16:48
CSS: CSS Hacks - Targeting only Firefox
/*From http://css-tricks.com/snippets/css/css-hacks-targeting-firefox/*/
@-moz-document url-prefix() {
.selector {
color:lime;
}
}
@jbutko
jbutko / index.html
Created November 30, 2013 12:51
CSS, HTML: Centered h2 Heading
<div id="tagline">
<div class="container group">
<h2 id=""><span id="aeaoofnhgocdbnbeljkmbjdmhbcokfdb-mousedown">Come work with us</span></h2>
</div><!-- /end container -->
</div>
@jbutko
jbutko / batch.bat
Created December 8, 2013 14:02
cmd.exe, Windows: Run a Windows (“DOS”) batch cmd script minimized
if not "%minimized%"=="" goto :minimized
set minimized=true
start /min cmd /C "%~dpnx0"
goto :EOF
:minimized
rem Anything after here will run in a minimized window
@jbutko
jbutko / sass.bat
Created December 8, 2013 14:08
SASS, SCSS, CSS, cmd.exe: Batch script to watch SASS files in Windows
REM Save this ass sass.bat and starts this at the beginning of the development process
REM (c) Jozef Butko
CMD /k "cd "c:\xampp\htdocs\wp\wp-content\themes\portfolio\library\" & sass --watch --sourcemap scss/style.scss:css/style.css"
@jbutko
jbutko / style.scss
Created December 10, 2013 18:29
CSS, SASS, SCSS: Center-align a block level element
@mixin center-block {
display: block;
margin-left: auto;
margin-right: auto;
}
// http://web-design-weekly.com/blog/2013/05/12/handy-sass-mixins/
@jbutko
jbutko / style.scss
Created December 10, 2013 18:51
SCSS, SASS, CSS: Margin mixin
/*
Mixin for consistent top/bottom margin, default 64px
Usage:
@include margin(top, 2);
Result: margin-top: 32px;
(C) Jozef Butko
*/
@jbutko
jbutko / Gruntfile.js
Created December 20, 2013 10:19
Grunt: Load Grunt tasks automatically
// install matchdep
npm install matchdep --save-dev
// and insert this into gruntfile.js
require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks);
@jbutko
jbutko / Gruntfile.js
Created December 20, 2013 10:28
Grunt: Rename task
// rename tasks
grunt.renameTask('rsync', 'deploy');