Skip to content

Instantly share code, notes, and snippets.

@iba-cmsteam
iba-cmsteam / allnumbers
Created February 16, 2017 08:56
jQuery.input only numbers
$(".numonly").keydown(function (e) {
// Allow: backspace, delete, tab, escape, enter and .
if ($.inArray(e.keyCode, [46, 8, 9, 27, 13, 110, 190]) !== -1 ||
// Allow: Ctrl+A, Command+A
(e.keyCode === 65 && (e.ctrlKey === true || e.metaKey === true)) ||
// Allow: home, end, left, right, down, up
(e.keyCode >= 35 && e.keyCode <= 40)) {
// let it happen, don't do anything
return;
}
@iba-cmsteam
iba-cmsteam / curdate.modx
Created February 20, 2017 08:43
ModX. current date without snippet
[[!+nowdate:default=`now`:strtotime:date=`%Y`]]
@iba-cmsteam
iba-cmsteam / graient.text.css
Created April 19, 2017 14:02
CSS.gradient text
h1 {
font-size: 72px;
background: -webkit-linear-gradient(#eee, #333);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
}
@iba-cmsteam
iba-cmsteam / gradient.underlines.css
Created April 19, 2017 14:03
CSS.gradient underlines
a {
position: relative;
padding-bottom: 2px;
text-decoration: none;
}
a:hover::after {
content: "";
position: absolute;
bottom: 2px;
@iba-cmsteam
iba-cmsteam / longwords.breaks.css
Last active April 19, 2017 14:04
CSS.long words breaks
.dont-break-out {
/* These are technically the same, but use both */
overflow-wrap: break-word;
word-wrap: break-word;
-ms-word-break: break-all;
/* This is the dangerous one in WebKit, as it breaks things wherever */
word-break: break-all;
/* Instead use this non-standard one: */
@iba-cmsteam
iba-cmsteam / layered.paper.css
Created April 19, 2017 14:05
CSS.layered paper
.layered-paper {
background: #eee;
box-shadow:
0 1px 1px rgba(0,0,0,0.15), /* The top layer shadow */
0 10px 0 -5px #eee, /* The second layer */
0 10px 1px -4px rgba(0,0,0,0.15), /* The second layer shadow */
0 20px 0 -10px #eee, /* The third layer */
0 20px 1px -9px rgba(0,0,0,0.15); /* The third layer shadow */
}
@iba-cmsteam
iba-cmsteam / monotote.img.css
Created April 19, 2017 14:07
CSS.monotone img
.filtered {
-webkit-filter: grayscale(100%);
filter: grayscale(100%);
}
@iba-cmsteam
iba-cmsteam / monotone.color.css
Created April 19, 2017 14:08
CSS.monotone.color.css
.filtered {
background: yellow;
position: relative;
}
.filtered img {
-webkit-filter: grayscale(100%);
filter: grayscale(100%);
opacity: 0.5;
}
@iba-cmsteam
iba-cmsteam / remove.link.dotted.css
Created April 19, 2017 14:09
CSS.remove link dotted
@iba-cmsteam
iba-cmsteam / blockquote.css
Created April 19, 2017 14:10
CSS.blockquote.css
blockquote {
background: #f9f9f9;
border-left: 10px solid #ccc;
margin: 1.5em 10px;
padding: 0.5em 10px;
quotes: "\201C""\201D""\2018""\2019";
}
blockquote:before {
color: #ccc;
content: open-quote;