Skip to content

Instantly share code, notes, and snippets.

View meded90's full-sized avatar
🎖️
Focusing

Kirill Baldin meded90

🎖️
Focusing
View GitHub Profile
@meded90
meded90 / initAnimate.js
Created August 21, 2013 05:35
showing block after scrolling to him dependence: Modernizr http://modernizr.com/ appear https://github.com/bas2k/jquery.appear/
if (!Modernizr.cssanimations || !Modernizr.csstransforms) {
$('.js-animate').addClass("js-animate")
}
var countAnimateStek = 1
$('.js-animate').appear(function (e, a) {
var $this = $(this);
var typeAnimate = $this.data('typeAnimate') || 'fadeInUp'
countAnimateStek++
function animateStart() {
$this.oneAnimationEnd(function (e) {
@meded90
meded90 / UMD.js
Created December 16, 2013 20:03
Universal Module Definition — уневерсальное объявление модуля
(function(window, factory) {
if (typeof exports === "object") {
// Node. Does not work with strict CommonJS, but only CommonJS-like
// enviroments that support module.exports, like Node.
module.exports = factory();
} else if (typeof define === "function" && define.amd) {
// Allow using this built library as an AMD module in another project. That
// other project will only see this AMD call, not the internal modules in
// the closure below.
define(factory);
@meded90
meded90 / Настройки file watchers
Last active December 31, 2015 13:39
WebStorm (jetbrens) setings file watchers for compass (sass/scss) to windows 7
Program: C:\Program Files (x86)\Git\bin\bash.exe
Arguments: --login -c "compass compile"
Working directory: $ProjectFileDir$
Output paths to refresh: $/FileDirRelativeToProjectRoot$/$FileNameWithoutAllExtensions$.css:$/FileDirRelativeToProjectRoot$/$FileNameWithoutAllExtensions$.map
@meded90
meded90 / ajaxLink.js
Created December 20, 2013 11:55
для ria приложений на backbone and marionettjs ссылки прикручиваем к роутерам
@meded90
meded90 / duration
Last active January 2, 2016 19:19
Handlebars Helper: Moment.js, for web app not node.js
define(['handlebars','moment','underscore'], function (Handlebars,moment,_) {
Handlebars.registerHelper("duration", function (context, block) {
if (context && context.hash) {
block = _.clone(context);
context = 0;
}
var duration = moment.duration(context);
// Reset the language back to default before doing anything else
@meded90
meded90 / new_gist_file.js
Created February 5, 2014 16:07
Колонки одинаковой высоты
var maxheight = 0;
$("div.col").each(function() {
if($(this).height() > maxheight) { maxheight = $(this).height(); }
});
$("div.col").height(maxheight);
@meded90
meded90 / gulpfile.js
Created February 23, 2014 06:08
coffe-script gulpfile config From https://github.com/gulpjs/gulp/issues/103
require('coffee-script') // this will be |require('coffee-script/register')| after release
require('./gulpfile.coffee')
@meded90
meded90 / add-Profile.js
Last active September 24, 2015 03:55 — forked from anonymous/get-all-login-sms-reg
взять все логины и пароли из sms-reg.com
var a = [
{"password": "", "phone": ""},
]
var i = a.length;
var iteratorProfile = function () {
$.post(
"http://liker5.ru/api/v1/profiles?type=like-photo",
a[i]
).always(function () {
@meded90
meded90 / parametr url
Created November 16, 2014 12:47
парсим урл
$.QueryString = (function(a) {
if (a == "") return {};
var b = {};
for (var i = 0; i < a.length; ++i)
{
var p=a[i].split('=');
if (p.length != 2) continue;
b[p[0]] = decodeURIComponent(p[1].replace(/\+/g, " "));
}
@meded90
meded90 / save-form.js
Last active September 24, 2015 03:54
Сохроняем в введеные пользователем формы
// возвращает cookie если есть или undefined
function getCookie(name) {
var matches = document.cookie.match(new RegExp(
"(?:^|; )" + name.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g, '\\$1') + "=([^;]*)"
))
return matches ? decodeURIComponent(matches[1]) : undefined
}
// уcтанавливает cookie
function setCookie(name, value, props) {