Skip to content

Instantly share code, notes, and snippets.

View mrfratello's full-sized avatar

John Syomochkin mrfratello

View GitHub Profile
curl https://bootstrap.pypa.io/get-pip.py | python
LSCOLORS The value of this variable describes what color to use
for which attribute when colors are enabled with
CLICOLOR. This string is a concatenation of pairs of the
format fb, where f is the foreground color and b is the
background color.
The color designators are as follows:
a black
b red
@mrfratello
mrfratello / hg-stats-by-author.sh
Last active June 19, 2018 19:30
Statistics by author in SCM Mercurial
# Статистика количество коммитов у каждого автора
hg log --template "{author|person}\n" | sort | uniq -c | sort -nr
hg churn -c
# Статистика по затронотым строкам каждым авторам за все время
hg churn --diffstat
# Статистика по комитам каждого файла
hg diff -r 0 -r tip --stat
@mrfratello
mrfratello / python_instalation.md
Created July 14, 2017 19:40
Instructions for the initial installation of Python tools for working with projects

Установка интерпретатора Python

На операционных системах Linux и MacOS уже предустановлен интерпретатор Python версии 2.7. Для OS Windows необходимо скачать установочный файл необходимой версии с официального сайта и запустить его.

Установка Python на Windows

Для использования интерпретатора в OS Windows можно воспользоваться эмулятором, который идет в комплекте с установкой Python.

Но в данном пример будет рассмотрен способ запуска интерпретатора через командную строку.

@mrfratello
mrfratello / PDO_connection.php
Created May 6, 2017 06:29
Материалы для дополнительного занятия "работа с PDO"
<?php
$host = "";
$user = "";
$pass = "";
$database_name = "";
try {
$dbh = new PDO("mysql:host=$host;dbname=$database_name", $user, $pass);
} catch (PDOException $e) {
echo "Error: " . $e->getMessage() . "<br/>";
@mrfratello
mrfratello / .htaccess
Created April 15, 2017 07:23
apache options for MVC on PHP
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?route=$1 [L,QSA]
@mrfratello
mrfratello / hint linux command.md
Last active May 24, 2023 12:40
hint by lunix commands in terminal
  1. How long the system has been running

uptime

  1. Find id of process then kill it
ps axu | grep process_name
kill -9 process_id
@mrfratello
mrfratello / codemirror_example.html
Created April 7, 2017 10:22
CodeMirror example of dynamic change mode and text
<!DOCTYPE html>
<html>
<head>
<title>Code mirror test</title>
<link rel="stylesheet" type="text/css" href="lib/lib/codemirror.css">
<script type="text/javascript" src="lib/lib/codemirror.js"></script>
<script src="lib/mode/javascript/javascript.js"></script>
<script src="lib/mode/python/python.js"></script>
<script src="lib/mode/htmlembedded/htmlembedded.js"></script>
<script src="lib/mode/htmlmixed/htmlmixed.js"></script>
tail -f path/to/log | ccze --mode ansi
@mrfratello
mrfratello / ajax_jquery.html
Created February 12, 2017 17:30
html template with example of ajax-request using jQuery library.
<!DOCTYPE html>
<html>
<head>
<title>AJAX on jQuery Example</title>
</head>
<body>
<script type="text/javascript" src="https://code.jquery.com/jquery-1.7.2.min.js"></script>
<script type="text/javascript">
jQuery.ajax({
url: '/some_page',