This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/******************** Обратный отсчет *************************/ | |
var month = new Date().getMonth() + 1; | |
if (month == 0) {month++;}; | |
console.log(month); | |
var currentDate = new Date(); | |
var futureDate = new Date(2015, month, 1); | |
var diff = futureDate.getTime() / 1000 - currentDate.getTime() / 1000; | |
/*var diff = 3600 * 24 * 20.17535;*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo chown -R www-data /путь/к корню/сайта/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.IO; | |
using System.Net; | |
namespace SEO_Analyzer.Helpers | |
{ | |
public class ParseHelper | |
{ | |
public static string DownloadHtml(string uri) | |
{ | |
HttpWebRequest request = WebRequest.Create(uri) as HttpWebRequest; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1) max-width: n px(%); word-wrap:break-word; text-overflow: ellipsis; white-space: none; | |
2) .hyphens { | |
-webkit-hyphens: auto; | |
-moz-hyphens: auto; | |
-ms-hyphens: auto; | |
hyphens: auto; | |
} | |
3) .word-break { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('#button-filter').on('click', function(bf) { | |
var stepCount = 2; | |
var currentUrl = window.location; | |
var firstAddr = currentUrl.pathname.toString().match(/^\/[a-z]*\/?/); | |
window.location = location.protocol + "//" + location.hostname + firstAddr[0] + location.search; | |
//window.history.go( - stepCount); | |
bf.stopImmediatePropagation(); | |
}); | |
//OR |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type="text/javascript"> | |
$('input[type="checkbox"]').on("click", function() { | |
var items = $(this).closest("li").find("input"); | |
if ($(this).is(':checked')) { | |
for(var i = 0; i< items.length; i ++) { | |
items[i].checked = true; | |
} | |
}else { | |
console.log("false"); | |
for(var i = 0; i< items.length; i ++) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git push origin HEAD:branch_name |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php if ($product['quantity'] > 0) { ?> | |
<p class="product-exist">В наличии</p> | |
<?php } else { ?> | |
<p class="product-not-exist">Нет в наличии</p> | |
<?php } ?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function User(name) { | |
//Если конструктор вызван без ключевого слова new, this это window | |
//B таком случае вызывается этот же конструктор, но с ключевым словом new | |
if(!(this instanceof User)) { | |
return new User(name); | |
} | |
this.name = name; | |
}; |