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 / JS document ready
Created March 3, 2016 14:20
JS document ready
document.addEventListener("DOMContentLoaded", function() {
//Code
});
@xto3na
xto3na / "История развития" переход по годам.
Created March 2, 2016 12:27
"История развития" переход по годам.
<? CJSCore::Init(array("jquery"));?>
<script>
var years = document.querySelectorAll(".history_vertical_year");
years[0].classList.add("active");
var clickYearHandler = function (el) {
var len = years.length;
for(var i = len; i > 0; i --){
years[i-1].classList.remove("active");
@xto3na
xto3na / gradient_border.css
Created January 24, 2016 11:14
Gradient border
.box {
margin: 80px 30px;
width: 200px;
height: 200px;
position: relative;
background: #fff;
float: left;
}
.box:before {
content: '';
@xto3na
xto3na / Image Maps
Created January 14, 2016 21:48
Image Maps
<img src="img.png" usemap="#btn_link" width="0" height="0" alt="" />
<map name="btn_link">
<area shape="rect" coords="0,0,0,0" href="http://www.quizful.net" target="_blank" alt="" />
</map>
<!DOCTYPE html>
<html>
<head>
<title>CSS3 Checkbox</title>
<style type="text/css">
.checkbox {
width: 30px;
height: 30px;
background-color: #ddd;
position: relative;
@xto3na
xto3na / AutoSave in localStorage
Created January 10, 2016 16:42
AutoSave in localStorage
if (window.localStorage) {
var elements = document.querySelectorAll('[name]');
for (var i = 0, length = elements.length; i < length; i++) {
(function(element) {
var name = element.getAttribute('name');
element.value = localStorage.getItem(name) || '';
element.onkeyup = function() {
@xto3na
xto3na / My_gulpfile.js
Created January 8, 2016 23:45
My_gulpfile.js
;(function () {
'use strict';
var gulp = require('gulp'),
prefixer = require('gulp-autoprefixer'),
uglify = require('gulp-uglify'),
sass = require('gulp-sass'),
sourcemaps = require('gulp-sourcemaps'),
rigger = require('gulp-rigger'),
@xto3na
xto3na / Регулярка для имени файла из пути
Created December 23, 2015 22:05
Регулярка для имени файла из пути
[\sA-Za-zА-ЯЁа-яё0-9-:]+\.[\w-]+
@xto3na
xto3na / Table Width Styling
Created December 18, 2015 18:52
Table Width Styling
//Задание одинаковых минимальных и максимальных значений
<td style="max-width:200px; min-width:200px; max-height:50px; min-height:50px; width:200px; height:50px;">
.td_size {
width:200px;
height:50px;
max-width:200px;
min-width:200px;
max-height:50px;
min-height:50px;
@xto3na
xto3na / 0_reuse_code.js
Created December 7, 2015 18:43
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console