Skip to content

Instantly share code, notes, and snippets.

View xto3na's full-sized avatar

Sergey Ponomarenko xto3na

  • Dnepropetrovsk, Ukraine
View GitHub Profile
@xto3na
xto3na / Paddings and margins helpers generate in SCSS
Created April 11, 2017 06:23
Paddings and margins helpers generate in SCSS
@for $i from 0 through 50 {
.mt-#{$i} {
margin-top: #{$i}px !important;
}
}
@for $i from 0 through 50 {
.mb-#{$i} {
margin-bottom: #{$i}px !important;
}
}
@xto3na
xto3na / Regexp for price from text
Last active February 19, 2017 14:03
Regexp for price from text
([\d]+\.*[\d]+)
из строки "розничная цена: 154.22 грн" достанет "154.22"
или из строки "розничная цена: 15422 грн" достанет "15422"
@xto3na
xto3na / Слежение за курсором на jquery
Created February 11, 2017 23:11
Слежение за курсором на jquery
<div class="move-wrap">
<div id="follower"></div>
</div>
<style>
#follower{
position : relative;
background-color : #000;
width:10px;
height:10px; /* Размеры движущегося объекта */
@xto3na
xto3na / KeyframesExplosionAnimation(Emmet).html
Last active February 7, 2017 09:12
Keyframes Explosion Animation
.particle*400
@xto3na
xto3na / Regexp for id from url
Created January 18, 2017 12:59
Regexp for id from url
/[^\.*+product_id=][0-9*].*/
Чтоб достать id из строки '/index.php?route=product/product&product_id=1643' // Результат - '1643'
@xto3na
xto3na / REDIRECT for Web.config
Created December 18, 2016 11:36
REDIRECT for Web.config
<!-- Redirect -->
<system.webServer>
<rewrite>
<rules>
<rule name="Redirect" stopProcessing="true">
<match url=".*" />
<action type="Redirect" url="http://not-found.com/" redirectType="Permanent" />
</rule>
</rules>
</rewrite>
@xto3na
xto3na / Upload input Styling
Last active November 24, 2016 14:56
Upload input Styling
<label class="file_upload">
<span class="button">Choose</span>
<mark>The file is not selected</mark>
<input type="file"/>
</label>
<style>
// File upload inputs styles
.file_upload{
background: #fff;
@xto3na
xto3na / Select validation required
Created September 19, 2016 15:22
Select validation required
<select class="required day" name="profileInputId_29412">
<option value="0">Выберите день *</option>
<option value="1">Пятница 19-22</option>
<option value="2">Суббота 19-22</option>
</select>
<script>
document.addEventListener("DOMContentLoaded", function(){
$("#sub_form").validate({
@xto3na
xto3na / Date input format
Created September 14, 2016 08:53
Date input format
$(".date-of-birth").on("blur", function () {
var str = $(".date-of-birth").val();
$(".date-of-birth").val(str.replace(/[^\/0-9]/g,''));
});
@xto3na
xto3na / CSS check input for non-empty
Created September 9, 2016 08:39
CSS check input for non-empty
input[type="text"]:not(:placeholder-shown) {
border-color: #4F4F4F;
}