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
<?php | |
define('DB_USER', "root"); //login DB | |
define('DB_PASSWORD', ""); // password DB | |
define('DB_DATABASE', "DataBaseName"); // name DB | |
define('DB_SERVER', "127.0.0.1"); // server IP | |
?> |
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
<?php | |
class DB_CONNECT { | |
function __construct() { | |
$this->connect(); | |
} | |
function __destruct() { | |
$this->close(); |
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
<!doctype html> | |
<html> | |
<head> | |
<meta charset="utf8"> | |
<title> Site news </title> | |
</head> | |
<body> | |
<div> <p>Спасибо за обращение! Ваше сообщение отправлено.</p> </div> |
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
// Создаем виджет BlogTool.ru | |
class btru_widget extends WP_Widget { | |
function __construct() { | |
parent::__construct( | |
// Выбираем ID для своего виджета | |
'btru_widget', | |
// Название виджета, показано в консоли | |
__('BlogTool Widget', 'btru_widget_domain'), |
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
JS: | |
$(".accordeon dd").hide().prev().click(function() { | |
$(this).parents(".accordeon").find("dd").not(this).slideUp().prev().removeClass("active"); | |
$(this).next().not(":visible").slideDown().prev().addClass("active"); | |
}); | |
CSS: | |
.accordeon .active { color: red } | |
HTML: |
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
<?php | |
// Вывод даты на русском | |
$monthes = array( | |
1 => 'Января', 2 => 'Февраля', 3 => 'Марта', 4 => 'Апреля', | |
5 => 'Мая', 6 => 'Июня', 7 => 'Июля', 8 => 'Августа', | |
9 => 'Сентября', 10 => 'Октября', 11 => 'Ноября', 12 => 'Декабря' | |
); | |
echo(date('d ') . $monthes[(date('n'))] . date(' Y, H:i')); | |
// Вывод дня недели |
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
//Set timeout if hover over an element | |
$(document).ready(function() { | |
$('#slider').hover( | |
// if hover over an element | |
function(){ | |
setTimeout(function() { | |
$('i.arrows').css({"opacity":"1"}); | |
}, | |
300); |
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
try { | |
String DisplayName = "XYZ"; | |
String MobileNumber = "123456"; | |
String HomeNumber = "1111"; | |
String WorkNumber = "2222"; | |
String emailID = "[email protected]"; | |
String company = "bad"; | |
String jobTitle = "abcd"; | |
ArrayList<ContentProviderOperation> ops = new ArrayList < ContentProviderOperation > (); |
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
// Get bitmap shader circle img | |
public static Bitmap getCircleMaskedBitmapShader(Bitmap source, int radius) { | |
if (source == null) { return null; } | |
int diam = radius << 1; | |
Paint paint = new Paint(Paint.ANTI_ALIAS_FLAG); | |
Bitmap scaledBitmap = scaleTo(source, diam); | |
final Shader shader = new BitmapShader(scaledBitmap, Shader.TileMode.CLAMP, Shader.TileMode.CLAMP); |
OlderNewer