This file contains 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 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 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 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 i = 0; | |
(function() { | |
if (i < 10) { | |
document.body.innerHTML += i; | |
i++; | |
setTimeout(arguments.callee, 1000); | |
} else { | |
alert('Закончили'); | |
} | |
})(); |
This file contains 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 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 getWatchers(root) { | |
root = angular.element(root || document.documentElement); | |
var watcherCount = 0; | |
function getElemWatchers(element) { | |
var isolateWatchers = getWatchersFromScope(element.data().$isolateScope); | |
var scopeWatchers = getWatchersFromScope(element.data().$scope); | |
var watchers = scopeWatchers.concat(isolateWatchers); | |
angular.forEach(element.children(), function (childElement) { | |
watchers = watchers.concat(getElemWatchers(angular.element(childElement))); |
This file contains 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
<snippet> | |
<content><![CDATA[ | |
<!-- begin $1 --> | |
<div class="$1"> | |
$2 | |
</div> | |
<!-- end $1 --> | |
]]></content> | |
<!-- Optional: Set a tabTrigger to define how to trigger the snippet --> | |
<tabTrigger>di</tabTrigger> |
This file contains 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) Конкатенация: | |
$a = 10; | |
$b = 5; | |
<?php echo $a . $b; ?> | |
Это выражение выведет: "105". | |
2) Экранирование спецсимволов в строках: | |
$brand = "<p style=\"color: red;\"> \"AUDI\" </p>"; |
This file contains 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
/************************** CHOOSEN-FILTER-BLOCK *******************************/ | |
var choosen = {}; | |
choosen.listFilters = []; | |
choosen.update = function () { | |
this.listFilters = []; | |
$(".active_filter").each(function (index, elem) { | |
if ($(elem).attr("data-name") != "min_price" | |
&& $(elem).attr("data-name") != "max_price") { |
This file contains 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 myFunc = function() { | |
return function(){ | |
console.log("Hi!"); | |
} | |
}; | |
//Вызов | |
myFunc()(); //Выведет в консоль "Hi!" |