Skip to content

Instantly share code, notes, and snippets.

View nikartx's full-sized avatar
:electron:
Bio Robot

Ivan V nikartx

:electron:
Bio Robot
View GitHub Profile
@nikartx
nikartx / accordeon.txt
Created July 24, 2015 17:35
jQuery Accordeon
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:
@nikartx
nikartx / functions.php
Created July 17, 2015 15:45
Template wordpress widget
// Создаем виджет BlogTool.ru
class btru_widget extends WP_Widget {
function __construct() {
parent::__construct(
// Выбираем ID для своего виджета
'btru_widget',
// Название виджета, показано в консоли
__('BlogTool Widget', 'btru_widget_domain'),
@nikartx
nikartx / home.php
Last active October 12, 2015 20:46
Fish html page with news from site DB
<!doctype html>
<html>
<head>
<meta charset="utf8">
<title> Site news </title>
</head>
<body>
<div> <p>Спасибо за обращение! Ваше сообщение отправлено.</p> </div>
@nikartx
nikartx / db_connect.php
Created July 13, 2015 01:35
Connect to DB MySQL
<?php
class DB_CONNECT {
function __construct() {
$this->connect();
}
function __destruct() {
$this->close();
@nikartx
nikartx / db_config.php
Created July 13, 2015 01:34
MySQL Data Base settings
<?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
?>