This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* rem with fallback to px | |
* | |
* Use px as unit and only within a property. | |
* Default root font-size is standard 16px. | |
* | |
* Example: | |
* p { | |
* font-size: rem(18px); | |
* box-shadow: 0 0 rem(7px) #000; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# MIT © Sindre Sorhus - sindresorhus.com | |
# git hook to run a command after `git pull` if a specified file was changed | |
# Run `chmod +x post-merge` to make it executable then put it into `.git/hooks/`. | |
changed_files="$(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD)" | |
check_run() { | |
echo "$changed_files" | grep --quiet "$1" && eval "$2" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<snippet> | |
<content><![CDATA[ | |
#{\$${1:variable}} | |
]]></content> | |
<tabTrigger>val</tabTrigger> | |
<scope>source.sass</scope> | |
</snippet> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Read more plugin | |
* Can be anywhere in js, after jQuery is loaded | |
*/ | |
(function($){ | |
$.fn.read_more = function (opts) { | |
opts = opts || {}; | |
var textContent = opts.text || 'Číst více', | |
hideContent = opts.text || 'Skrýt', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@function black($opacity){ | |
@return rgba(0,0,0,$opacity) | |
} | |
@function white($opacity){ | |
@return rgba(255,255,255,$opacity) | |
} | |
@function grid($col){ | |
@return (($grid * $col) - $gutter) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* | |
* Enable the passage of the 'this' object through the JavaScript timers | |
* | |
**/ | |
var __nativeST__ = window.setTimeout, __nativeSI__ = window.setInterval; | |
window.setTimeout = function (vCallback, nDelay /*, argumentToPass1, argumentToPass2, etc. */) { | |
var oThis = this, aArgs = Array.prototype.slice.call(arguments, 2); | |
return __nativeST__(vCallback instanceof Function ? function () { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function($) { | |
$.fn.styledSelect = function() { | |
return this.each(function() { | |
var $this = $(this), | |
numberOfOptions = $(this).children('option').length; | |
$this.addClass('s-hidden'); | |
$this.wrap('<div class="styledSelect'+(($this.attr("data-class")) ? " "+$this.attr("data-class") : "")+'"></div>'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$sprites: sprite-map("sprites/*.png"); | |
$sprites-retina: sprite-map("sprites-retina/*.png"); | |
@mixin sprite-background($name) { | |
background-image: sprite-url($sprites); | |
background-position: sprite-position($sprites, $name); | |
background-repeat: no-repeat; | |
display: block; | |
height: image-height(sprite-file($sprites, $name)); | |
width: image-width(sprite-file($sprites, $name)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Function for parsing params from url (returning params in javascript object) | |
var parseUrlParams = function () { | |
var parReg = /[\?\&][a-zA-z0-9-~]+/g, | |
params = window.location.search.match(parReg), | |
result = {}; | |
for (var i = params.length - 1; i >= 0; i--) { | |
params[i] = params[i].substring(1); | |
var valReg = new RegExp('[?&]'+params[i]+'=([^&#]*)'), | |
val = window.location.search.match(valReg) ? window.location.search.match(valReg)[1] : null; |