Skip to content

Instantly share code, notes, and snippets.


Igor Ovsyanka

  • Russia, Kaliningrad
View GitHub Profile

Commit Message Guidelines

Short (72 chars or less) summary

More detailed explanatory text. Wrap it to 72 characters. The blank
line separating the summary from the body is critical (unless you omit
the body entirely).

Write your commit message in the imperative: "Fix bug" and not "Fixed
bug" or "Fixes bug." This convention matches up with commit messages
Ovsyanka / ruleset.xml
Last active February 20, 2020 11:10 — forked from gsherwood/ruleset.xml
PSR2 with tabs instead of spaces and bracers on the end of lines
View ruleset.xml
<?xml version="1.0"?>
<ruleset name="MyStandard">
PSR2 with changes:
* tabs instead of spaces (
* bracers on end of line instead new line
<!-- tabs -->
<arg name="tab-width" value="4"/>
Ovsyanka /
Created September 27, 2015 17:30
Take assigning to group without relogin
# it can not be executed as script because newgrp starting a new shell
# src:
currentGrpId=`id -g`
exec newgrp $newGrpName
exec newgrp #$currentGrpId
Ovsyanka /
Created September 27, 2015 17:09
linux: parent shell user
parentShellUser=`ps u -p $PPID | awk '{print $1}'|tail -1`
echo $parentShellUser
Ovsyanka / fullYearsBetween.js
Created January 22, 2014 10:46
calculate full years number between two dates
View fullYearsBetween.js
yearsBetween = function(d1, d2, roundUp) {
// dates parsing by sugarjs
var d1 = Date.create(d1);
var d2 = Date.create(d2);
var range = d2.getFullYear() - d1.getFullYear();
if (d2.setFullYear(1972) < d1.setFullYear(1972)) range--;
if (roundUp && d2.getTime() !== d1.getTime()) range++;
return range;