Skip to content

Instantly share code, notes, and snippets.

@webyroki
webyroki / index.jade
Created October 5, 2015 17:53
Пример jade разметки
html
header
body
@webyroki
webyroki / new_gist_file.css
Last active February 20, 2016 22:13
Красивая кнопка без JS http://jsfiddle.net/udp2153x/
body {
background: #A7A9AC;
background-image: -webkit-gradient(
linear,
left top,
right top,
color-stop(.34, rgba(230,237,241,.05)),
color-stop(.67, rgba(230,237,241,0)));
-webkit-background-size: 5px 5px;
}
@webyroki
webyroki / .css
Last active February 20, 2016 11:10
Подсветка активного пункта меню
jQuery(document).ready(function($) {
$('.navigation a[href^="/' + location.pathname.split("/")[1] + '"]').addClass('active');
});
Или для пункта li class
jQuery(document).ready(function($) {
$('.navigation a[href^="/' + location.pathname.split("/")[1] + '"]').parent("li").addClass('active');
});
@webyroki
webyroki / new_gist_file.tex
Created February 20, 2016 23:06
Показ/Скрытие левого сайдбара
{ "keys": ["Ctrl+f1"], "command": "toggle_side_bar" }
@webyroki
webyroki / index.js
Created February 20, 2016 23:49
активный пункт меню тег li
<script type="text/javascript">
$(document).ready(function(){
var link = window.location.pathname;
$('.navbar li a[href="'+link+'"]').parent().addClass('active');
});
</script>
@webyroki
webyroki / chat.php
Last active February 21, 2016 16:46 — forked from iGusev/chat.php
php-chat
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title></title>
<meta http-equiv="refresh" content="2">
<link href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css" rel="stylesheet">
<style type="text/css">
.chat-body {
margin-bottom: 10px;
@webyroki
webyroki / gist:451958439d460ec3d8e5
Created February 21, 2016 16:50 — forked from sotarok/gist:33390
php simple chat
<?php
define("URL", "http://あなたの設置したPHPファイルのURL");
define("TIME", time());
define("__THIS_FILE__", file_get_contents(__FILE__));
define("__THIS_SCRIPT__", substr(__THIS_FILE__, 0, strpos(__THIS_FILE__, "__" . "halt_compiler();") + 19));
$logs = explode("\n", substr(__THIS_FILE__, strpos(__THIS_FILE__, "__" . "halt_compiler();") + 19));
if (strcasecmp($_SERVER['REQUEST_METHOD'], 'post') == 0) {
if (isset($_POST['text']) && !empty($_POST['text'])
&& isset($_POST['name']) && !empty($_POST['name'])) {
@webyroki
webyroki / Create_table.sql
Created February 21, 2016 16:52 — forked from ashutoshlr/Create_table.sql
PHP - Chat Application
CREATE TABLE `s_chat_messages` (
`id` INT(11) NOT NULL AUTO_INCREMENT ,
`user` VARCHAR(255) NOT NULL ,
`message` VARCHAR(255) NOT NULL ,
`when` INT(11) NOT NULL ,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
@webyroki
webyroki / new_gist_file.css
Created February 26, 2016 11:17
Три колонки резиновой ширины 25% 50% 25% + margin + padding
h1 {
text-align: center;
color: #FFF;
margin: 0;
}
.wrapper{
background: #34495e;
width: 1000px;
padding: 10px;
margin: 0 auto;