Skip to content

Instantly share code, notes, and snippets.

View xTNTx's full-sized avatar

Oleg Iasinovskyi xTNTx

  • Wise Engineering
  • Ukraine
View GitHub Profile
@xTNTx
xTNTx / README.md
Created May 24, 2019 09:36
Enable git hook protection in master branch
  1. git config --global init.templatedir '~/.git-templates' - so git will copy all templates into new or cloned repository
  2. mkdir -p ~/.git-templates/hooks
  3. touch ~/.git-templates/hooks/pre-commit
  4. chmod +x ~/.git-templates/hooks/pre-commit
  5. Update ~/.git-templates/hooks/pre-commit with the following content

BRANCH="$(git rev-parse --abbrev-ref HEAD)"

MASTER_CHECK_ENABLED="$(git config --get custom.hooks.mastercheck || echo 'true')"
@xTNTx
xTNTx / user-ids.csv
Created March 29, 2018 10:58
temp for test
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
200
201
202
203
@xTNTx
xTNTx / jq-cheetsheet
Last active August 27, 2017 16:53
jq cheetsheet
# Get most common errors sorted descending
cat input \
| jq '. | select(.level | contains("info") | not)' \
| jq -C -s 'group_by(.msg) | map({msg: .[0].msg, amount: . | length, hosts: [.[].host] | unique}) | sort_by(.amount) | reverse'
| less -R
@xTNTx
xTNTx / Preferences.sublime-settings
Created January 19, 2017 13:01
Sublime Text setting for students
{
"draw_white_space": "all",
"ensure_newline_at_eof_on_save": true,
"line_padding_bottom": 1,
"line_padding_top": 1,
"translate_tabs_to_spaces": true,
"trim_trailing_white_space_on_save": true
}
@xTNTx
xTNTx / Vagrantfile
Last active December 9, 2016 22:10
Ubuntu 32 bit
Moved to https://github.com/xTNTx/vagrant-templates
@xTNTx
xTNTx / Vagrantfile
Last active December 9, 2016 22:06
Ubuntu 64
Moved to https://github.com/xTNTx/vagrant-templates
@xTNTx
xTNTx / ws-request-example.php
Last active May 5, 2016 17:15
[WS] Request example
<?php
class Request
{
public $method;
public $postData;
public function __construct(argument)
{
root = true
[*]
indent_style = space
indent_size = 4
insert_final_newline = true
trim_trailing_whitespace = true
{
"bold_folder_labels": true,
"color_scheme": "Packages/User/SublimeLinter/darkula (SL).tmTheme",
"draw_white_space": "all",
"ensure_newline_at_eof_on_save": true,
"folder_exclude_patterns":
[
".svn",
".git",
".hg",