Skip to content

Instantly share code, notes, and snippets.

View itd24's full-sized avatar

Ziga Petek itd24

View GitHub Profile
@itd24
itd24 / JS: validiraj email
Created June 3, 2013 06:33
JS: funkcija validira email @email - vrednost katero preverjamo @return - vrne true če je mail ok, false drugače
function validateEmail(email) {
var re = /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
return re.test(email);
}
@itd24
itd24 / SQL: povečaj counter v bazi
Created June 3, 2013 06:39
SQL: poveča counter v bazi @tabela - tabela v bazi @counter - vrednost ki jo želimo povečati za 1 @id identifikator po katerem najdemo pravo vrstico @vr - vrednost identifikatorja, katerega iščemo
UPDATE @tabela SET @counter=@counter+1 WHERE @id=@vr
@itd24
itd24 / .gitignore
Created February 23, 2016 09:14 — forked from salcode/.gitignore
.gitignore file for WordPress - Bare Minimum Git
# -----------------------------------------------------------------
# .gitignore for WordPress
# Bare Minimum Git
# http://ironco.de/bare-minimum-git/
# ver 20150227
#
# This file is tailored for a WordPress project
# using the default directory structure
#
# This file specifies intentionally untracked files to ignore
--my-custom-color: green;
.my-custom-buttom{
--my-custom-color: green;
background-color: var(--my-custom-color); /*this works*/
}
.another-custom-button{
background-color: var(--my-custom-color); /*this doesn't*/
}
.my-custom-class{
--my-custom-color: green;
background-color: var(--my-custom-color);
}
:root{
--my-custom-color: green;
}
.my-custom-buttom{
background-color: var(--my-custom-color); /*this works*/
}
.another-custom-button{
background-color: var(--my-custom-color); /*this works too*/
}
.root-element{
--background-color: red;
}
.root-button{
background-color:var(--background-color);
}
.inner-container{
--background-color: green;
}
<div class="root-element">
<div class="root-button">I'm the root button</div>
<div class="inner-container">
<div class="inner-container-button">And I'm the inner container button"></div>
</div>
</div>
:root{
--background-color-a: green;
--background-color-b: red;
--background-color-c: blue;
}
.teaser{
background-color: var(--bg-color-a, --bg-color-b, --bg-color-c, #326cc2);
}