Skip to content

Instantly share code, notes, and snippets.

@rozklad
rozklad / index.php
Last active December 16, 2015 10:19
WP: add category to body_class
<?php
// TODO: rewrite as filter
$class = array();
$prefix = 'category-'';
foreach(get_the_category() as $category) {
$class[] = $prefix . $category->slug;
$class[] = $prefix . $category->cat_ID;
}
?>
<body <?php body_class( $class ); ?>>
@rozklad
rozklad / player.as
Last active December 16, 2015 11:39
AS3 media player
package {
import flash.geom.*;
import flash.display.Loader;
import flash.display.MovieClip;
import flash.display.Stage;
import flash.display.StageScaleMode;
import flash.display.StageAlign;
import flash.display.StageDisplayState;
import flash.events.Event;
@rozklad
rozklad / breadcrumb.scss
Created June 20, 2013 11:58
arrowed breadcrumbs twitter-bootstrap
$unit: 20px; // some basic unit size
$color1: #FFF; // background-color
$color9: #DDD; // arrow background-color
.breadcrumb {
background-color: $color1;
margin-bottom: 0;
}
.breadcrumb {
.form-signin {
max-width: 330px;
padding: 15px;
margin: 0 auto;
.form-signin-heading, .checkbox {
margin-bottom: 10px;
}
.checkbox {
font-weight: normal;
}
@rozklad
rozklad / _browsehappy.scss
Last active December 23, 2015 11:00
sexy mini browsehappy
.browsehappy {
margin: 0.0em 0;
background: #232323;
color: #CCC;
padding: 1em 0;
text-transform: uppercase;
font-size: 10px;
text-align: center;
font-weight: bold;
font-family: sans-serif;
@rozklad
rozklad / dog_calendar.json
Created October 22, 2013 13:28
Dog calendar in cs-cz, psí kalendář v češtině, jeden z mnoha dostupných online :)
{
"1": {
"1":
"Agga",
"2":
"Joe",
"3":
"Jack",
"4":
"Ťapka",
<?php
// Configuration
$input['letter'] = 'A';
# $input['letter'] = '0-9'; // for numbers
// Basic arguments for WP query
$args = array(
'post_type' => 'post'
);
@rozklad
rozklad / mimetype2FontAwesome.php
Last active August 29, 2015 14:18
Turn MIME type into font awesome file icon name (e.g. file-text-o)
<?php
/**
* Turn mimetype into font awesome file icon name (e.g. file-text-o)
* @param string $mimetype File mimetype
* @return string Font Awesome file icon name
*/
function mimetype2FontAwesome($mimetype = null) {
switch( $mimetype ) {
body.login {
div#login {
h1 {
a {
}
}
form#loginform {
p {
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.