Skip to content

Instantly share code, notes, and snippets.

View julzmon's full-sized avatar
💭
Whasuuuup

Julian julzmon

💭
Whasuuuup
View GitHub Profile
@julzmon
julzmon / gist:17ad324cbc418e1267e9
Created September 2, 2014 00:51
Cut off long lines with ellipsis
.text-overflow {
white-space: nowrap; /* No line breaks */
overflow: hidden; /* Hide text which does not fit the block */
text-overflow: ellipsis; /* Cut off with ellipsis */
display: block; /* Works only for block elements */
}
@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;
}
{% set counter = 0 %}
{% for entity in itemsTotal if entity|length %}
{% set counter = counter + 1 %}
{% endfor %}
<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>
{% if currentUser.admin %}
{# Display an edit link for our admin #}
{{ entry.getCpEditUrl() }}
{% endif %}
// @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"
.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); }
@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) ";
}
/**
* 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 / 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") }}