Skip to content

Instantly share code, notes, and snippets.

View julzmon's full-sized avatar
💭
Whasuuuup

Julian julzmon

💭
Whasuuuup
View GitHub Profile
@julzmon
julzmon / list-craft-categories
Last active August 29, 2015 14:01
Craft loop through categories
{% for category in craft.categories.group('categorieName').find() %}
{{ category.title }}
{% endfor %}
@julzmon
julzmon / craft-date
Last active August 29, 2015 14:01
Craft date field showing only year or month
Like this: {{ entry.d_date.year }}
Or: {{ entry.d_date | date("Y") }}
Like this: {{ entry.d_date.month }}
Or: {{ entry.d_date | date("m") }}
/**
* Use em or rem font-size in Bootstrap 3
*/
@font-size-root: 14px;
@font-unit: 0rem; // Pick em or rem here
// Convert all variables to em
@julzmon
julzmon / gist:1515345cb81933e5e02b
Created May 27, 2014 02:48
Numbering With CSS
body {
countercounter-reset: number;
}
h1:before {
countercounter-increment: number;
content: "counter(number) ";
}
.make-column(@large, @medium, @small, @tiny: 16) {
.make-xs-column(@tiny);
.make-sm-column(@small);
.make-md-column(@medium);
.make-lg-column(@large);
}
section#main-content { .make-column(8,8,9,12); }
// @codekit-prepend "affix.js"
// @codekit-prepend "transition.js"
// @codekit-prepend "tooltip.js"
// @codekit-prepend "alert.js"
// @codekit-prepend "button.js"
// @codekit-prepend "carousel.js"
// @codekit-prepend "collapse.js"
// @codekit-prepend "dropdown.js"
// @codekit-prepend "modal.js"
// @codekit-prepend "popover.js"
{% if currentUser.admin %}
{# Display an edit link for our admin #}
{{ entry.getCpEditUrl() }}
{% endif %}
<div class="row">
{% for entry in entries %}
<div class="col-sm-4"></div>
<div class="col-sm-4"></div>
<div class="col-sm-4"></div>
{% if loop.index is divisible by(3) %}
<div class="row">
</div>
{% set counter = 0 %}
{% for entity in itemsTotal if entity|length %}
{% set counter = counter + 1 %}
{% endfor %}
@julzmon
julzmon / gist:d1508b5aaf20b317d311
Created September 2, 2014 00:50
Align a block in center and middle
{
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
margin: auto;
}