Skip to content

Instantly share code, notes, and snippets.

View miamibc's full-sized avatar
🌴

Sergei Miami miamibc

🌴
View GitHub Profile
# change lib/ apps/ to folders you worked in, remove grep php if you work not only with php files
git ls-tree --name-only -r HEAD lib/ apps/ | grep 'php' | xargs -n1 git blame -t -c -e | awk '{print $2}' | sort | uniq -c
# this will bring you number of lines each author contributed
# example:
# 14262 (<author@example.com>
# 364 (<noob@example.com>
# 3483 (<another@example.com>
# 36849 (<mastah@example.com>
# 48434 (<miami@blackcrystal.net>
@miamibc
miamibc / read_last_line.php
Created January 8, 2020 15:39
read last line(s) from very large file with php
/**
* read last line(s) from very large file
*
* @param string $filename filename to open
* @param integer $buffer Perfoorm search of last line in [buffer] bytes got from end of file
*
* @return string
*/
function read_last_line(string $filename, int $buffer = 1024*1024 )
@miamibc
miamibc / ubuntu16-mysql5.7-change-root-password.sh
Last active December 3, 2019 00:32
ubuntu 16 mysql 5.7 change root password
#!/bin/bash
# this sctipt will change mysql root password in 3 seconds
# run it with one parameter - desired password
if [ -z "$1" ]
then
echo "Usage: $0 <new password>"
exit 1
fi
@miamibc
miamibc / upload.js
Last active April 4, 2018 15:42 — forked from jorinvo/upload.js
jQuery html5 uploader
(function ($) {
$.fn.html5Uploader = function (options) {
var crlf = '\r\n';
var boundary = "iloveigloo";
var dashes = "--";
var settings = {
"name": "uploadedFile",
#!/bin/bash
SYMFREPO="git://symfony-git.git.sourceforge.net/gitroot/symfony-git/symfony-git" #this not works now
SYMFREPO="https://github.com/symfony/symfony1.git"
VENDOR_DIR="lib/vendor/symfony"
DBUSER="root"
DBPASS=""
AUTHOR=""