Работа с архивом linux консоль
Создать архив tar
1 |
tar -cf txt.tar *.txt |
Распаковать архив
1 |
tar -xvf /path/to/archive.tar.bz2 |
Создать архив tar
1 |
tar -cf txt.tar *.txt |
Распаковать архив
1 |
tar -xvf /path/to/archive.tar.bz2 |
1 2 |
RewriteCond %{HTTPS} off RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 |
.modal-window { position: fixed; z-index: 10000; width: 100%; top: 0; left: 0; display: none; height: 100%; background: rgba(255, 255, 255, 0.50); } .modal-windows-form { width: 390px; height: 360px; background-color: white; box-shadow: 0px 0px 20px rgba(0, 0, 0, 0.2); position: absolute; left: 0; right: 0; top: 0; bottom: 0; margin: auto; padding: 0px 80px; box-sizing: border-box; } .modal-windows-form h2 { width: 100%; text-align: center; margin: 20px 0px; font-size: 22px; } .modal-windows-form input[type="text"] { width: 100%; -webkit-box-sizing: border-box; box-sizing: border-box; border: none; background: #e6e7e8; color: black; padding: 5px 10px; font-size: 14px; margin-bottom: 10px; border-radius: 5px; } .modal-windows-form span { font-size: 14px; text-align: justify; margin-left: 10px; } .modal-windows-form textarea { width: 100%; -webkit-box-sizing: border-box; box-sizing: border-box; border: none; background: #e6e7e8; color: black; resize: none; height: 90px; padding: 5px 10px; font-size: 14px; margin-bottom: 10px; border-radius: 5px; } .modal-windows-form input[type="submit"] { border: none; background: #f9690e; color: white; width: 160px; margin: auto; display: block; height: 35px; margin-top: 20px; font-size: 16px; cursor: pointer; transition: 0.3s; border-radius: 5px; } .modal-windows-form input[type="submit"]:hover { background: #4ecdc4; } .modal-windows-form input[type="checkbox"] { display: inline-block; } button#form-close { border: none; outline: none; background: transparent; display: block; width: 10px; height: 10px; padding: 0; margin: 0; cursor: pointer; position: absolute; right: 10px; top: 10px; background-size: 10px; background-image: url(../img/cross.svg); } |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
<div class="modal-window"> <div class="modal-windows-form"> <button id="form-close"></button> <h2>Оставить заявку</h2> <form> <input type="text" name="username" value="" placeholder="Имя"> <input type="text" name="phone" value="" placeholder="Телефон"> <textarea placeholder="Сообщение"></textarea> <input type="checkbox" name="personalInfo"> <span>Я подтверждаю согласие на обработку <a href="#" rel="nofollow" class="super_url">персональных данных</a> </span> <input type="submit" name="submit" value="Отправить"> </form> </div> </div> |
1 2 3 4 5 6 7 |
$(document).on('click', '.send-letter', function(){ $('.modal-window').show(); }); $(document).on('click', '#form-close', function(){ $('.modal-window').hide(); }); |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
$url = 'http://localhost/post.php'; $params = array( 'param1' => '123', // в http://localhost/post.php это будет $_POST['param1'] == '123' 'param2' => 'abc', // в http://localhost/post.php это будет $_POST['param2'] == 'abc' ); $result = file_get_contents($url, false, stream_context_create(array( 'http' => array( 'method' => 'POST', 'header' => 'Content-type: application/x-www-form-urlencoded', 'content' => http_build_query($params) ) ))); echo $result; |
js
1 2 3 |
element = document.getElementById("brone_operators_id"); result = element.options[element.selectedIndex].text; console.log(result); |
jQuery
1 2 |
result = $("select#brone_operators_id option:selected").text(); console.log(result); |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
function defCopySite() { var istS = 'Узнайте больше на сайте:'; // Слово должно находится в кавычках! var copyR = '© matveevs.ru'; // Слово должно находится в кавычках! var body_element = document.getElementsByTagName('body')[0]; var choose = window.getSelection(); var myLink = document.location.href; var authorLink = "<br /><br />" + istS + ' ' + "<a href='" + myLink + "'>" + myLink + "</a><br />" + copyR; var copytext = choose + authorLink; var addDiv = document.createElement('div'); addDiv.style.position = 'absolute'; addDiv.style.left = '-99999px'; body_element.appendChild(addDiv); addDiv.innerHTML = copytext; choose.selectAllChildren(addDiv); window.setTimeout(function() { body_element.removeChild(addDiv); }, 0); } document.oncopy = defCopySite; |
1 2 3 4 5 6 7 8 |
input[type='number'] { -moz-appearance:textfield; } input::-webkit-outer-spin-button, input::-webkit-inner-spin-button { -webkit-appearance: none; } |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
$(document).on('click', '#send_form_callback', function() { $name = checkString('input[name="form_text_6"]'); $phone = checkString('input[name="form_text_7"]'); $email = checkString('input[name="form_email_8"]'); $comment = checkString('textarea[name="form_textarea_9"]'); if ($name && $phone && $email && $comment) { $('form[name="request_call"] input[name="web_form_submit"]').click(); } }); function checkString(id) { var item = $(id); if (item.val() == '') { item.css('border', '2px solid #da6060'); event.preventDefault(); return false; } else { item.css('border', '2px solid #2b9619'); return true; } } |
ЧПУ Битрикс urlrewrite.php
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
array( "CONDITION" => "#^/katalog/([a-z0-9\-]+)/([a-z0-9\-]+)/([a-z0-9\-]+)#", "RULE" => "SECTION_CODE_PATH=$3", "ID" => "bitrix:catalog.section.list", "PATH" => "/katalog/detail.php", ), array( "CONDITION" => "#^/katalog/([a-z0-9\-]+)/([a-z0-9\-]+)#", "RULE" => "SECTION_CODE_PATH=$2", "ID" => "bitrix:catalog.section.list", "PATH" => "/katalog/list.php", ), array( "CONDITION" => "#^/katalog/([A-z,0-9]+)#", "RULE" => "SECTION_CODE_PATH=$1", "ID" => "bitrix:catalog.section.list", "PATH" => "/katalog/index.php", ), |
function.php
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
/** * Галерея */ function imageArr ($post_id) { global $post; $defImg = get_gallery_images($post_id); $imageArr = array(); $per = get_post_gallery($post_id, false ); $perExlode = explode(",", $per['ids']); foreach ($perExlode as $key => $value) { $imageArr[$value] = $defImg[$key]; } if(count($imageArr)>1) { $result .='<div class="bx-galery" >'; foreach ($imageArr as $imgTitle => $imgSrc) { $imgTitle = get_the_title($imgTitle); $imagefull = $imgSrc; $image = aq_resize( $imgSrc, 200, 150, true ); //resize & crop img 140x100 $result .= "<div><a href='".$imagefull."' rel='lightbox' title='".$imgTitle."'><img src='".$image."' /></a></div>"; } $result .= "</div>"; return $result; } } |