Skip to content

Instantly share code, notes, and snippets.

@Serega1288
Serega1288 / html
Last active September 7, 2016 07:34
центровка обьектов по высоте js
function setEqualHeight(columns) {
var tallestcolumn = 0;
columns.each(
function()
{
currentHeight = $(this).height();
if(currentHeight > tallestcolumn)
{
tallestcolumn = currentHeight;
@Serega1288
Serega1288 / functions.php
Created November 7, 2015 20:57
wp кастумный тип
function create_articles() {
register_post_type('catalog', array(
'labels' => array(
'name' => __( 'Каталог' ),
'singular_name' => __( 'Весь товар' ),
'add_new' => __( 'Добавить товар' ),
'add_new_item' => __( 'Добавить товар' ),
'edit' => __( 'Редактировать товар' ),
'edit_item' => __( 'Редактировать товар' ),
@Serega1288
Serega1288 / index.html
Created October 29, 2015 13:49
validate script ajax
$(document).ready(function() {
$("#form-1").validate({
rules: {
name: { required: true},
email: { required: true},
phone: {required: true},
selectmenu: {required: true},
textarea: {required: true}
},
@Serega1288
Serega1288 / jquery.validate.min.js
Last active March 8, 2016 23:48
jquery.validate.min.js
/*! jQuery Validation Plugin - v1.11.1 - 3/22/2013\n* https://github.com/jzaefferer/jquery-validation
* Copyright (c) 2013 Jörn Zaefferer; Licensed MIT */(function(t){t.extend(t.fn,{validate:function(e){if(!this.length)return e&&e.debug&&window.console&&console.warn("Nothing selected, can't validate, returning nothing."),void 0;var i=t.data(this[0],"validator");return i?i:(this.attr("novalidate","novalidate"),i=new t.validator(e,this[0]),t.data(this[0],"validator",i),i.settings.onsubmit&&(this.validateDelegate(":submit","click",function(e){i.settings.submitHandler&&(i.submitButton=e.target),t(e.target).hasClass("cancel")&&(i.cancelSubmit=!0),void 0!==t(e.target).attr("formnovalidate")&&(i.cancelSubmit=!0)}),this.submit(function(e){function s(){var s;return i.settings.submitHandler?(i.submitButton&&(s=t("<input type='hidden'/>").attr("name",i.submitButton.name).val(t(i.submitButton).val()).appendTo(i.currentForm)),i.settings.submitHandler.call(i,i.currentForm,e),i.submitButton&&s.remove(),!1):!0}return i.setti
@Serega1288
Serega1288 / sendmessage.php
Last active December 7, 2015 19:06
sendmessage.php
<?php
$sendto = "***";
$name = $_POST['name'];
// Формирование заголовка письма
$subject = "Тема листа";
$headers = "From: [email protected] " . strip_tags($usermail) . "\r\n";
$headers .= "Reply-To: ". strip_tags($usermail) . "\r\n";
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-Type: text/html;charset=utf-8 \r\n";
@font-face {
font-family: Scriptorama;
src: local("Scriptorama"),
url(path-to/Scriptorama.eot);
}
@Serega1288
Serega1288 / bootstrap.css
Last active December 8, 2015 19:30
bootstrap Grid system css
/*!
* Bootstrap v3.3.1 (http://getbootstrap.com)
* Copyright 2011-2015 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
*/
/*!
* Generated using the Bootstrap Customizer (http://twbs.docs.org.ua/customize/?id=7b866147b218b82c84c0)
* Config saved to config.json and https://gist.github.com/7b866147b218b82c84c0
*/
@Serega1288
Serega1288 / index.html
Created October 28, 2015 14:07
start bootstrap html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Bootstrap 101 Шаблон</title>
<!-- Bootstrap -->
<link href="css/bootstrap.min.css" rel="stylesheet">
@Serega1288
Serega1288 / jquery.min.js
Last active December 5, 2015 15:12
jQuery v1.11.0
/*! jQuery v1.11.0 | (c) 2005, 2014 jQuery Foundation, Inc. | jquery.org/license */
!function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){var c=[],d=c.slice,e=c.concat,f=c.push,g=c.indexOf,h={},i=h.toString,j=h.hasOwnProperty,k="".trim,l={},m="1.11.0",n=function(a,b){return new n.fn.init(a,b)},o=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,p=/^-ms-/,q=/-([\da-z])/gi,r=function(a,b){return b.toUpperCase()};n.fn=n.prototype={jquery:m,constructor:n,selector:"",length:0,toArray:function(){return d.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:d.call(this)},pushStack:function(a){var b=n.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a,b){return n.each(this,a,b)},map:function(a){return this.pushStack(n.map(this,function(b,c){return a.call(b,c