Skip to content

Instantly share code, notes, and snippets.

View in8finity's full-sized avatar

Alexander Morozov in8finity

View GitHub Profile
@in8finity
in8finity / ansi-color.php
Last active August 29, 2015 14:27 — forked from superbrothers/ansi-color.php
ANSI color terminal output module for php
<?php
/**
* php-ansi-color
*
* Original
* https://github.com/loopj/commonjs-ansi-color
*
* @code
* <?php
* require_once "ansi-color.php";
@in8finity
in8finity / active_highlight.js
Last active November 25, 2015 22:52
Script to list all active links and active form elements on page and highlight em with borders (highlights first occurrence of link with red color, others - with yellow).
var links_hash = {};
function store_in_links_hash(href, item, container)
{
if(links_hash[href] == undefined)
{
links_hash[href] = item;
//item.css("background-color", "red");
//$(container).css("border", "2px solid red");
console.log(href);
@in8finity
in8finity / diff_feature_staging.sh
Last active December 22, 2016 14:56
Bash script to find diffs only in files from your feature between stage with multiple features
#!/bin/bash
STAGING_BRANCH=staging
DEVELOP_BRANCH=develop
BRANCH_NAME=`git branch --list | fzf`
COMMON_PARENT_COMMIT_HASH=`git merge-base $BRANCH_NAME $DEVELOP_BRANCH`
comm -12 <(git diff $BRANCH_NAME staging --name-only) <(git diff $COMMON_PARENT_COMMIT_HASH $BRANCH_NAME --name-only) \
| xargs -I{} git diff staging $BRANCH_NAME -- {}
@in8finity
in8finity / interactive_diff_feature_staging.sh
Created December 22, 2016 15:46
Interactive bash script to find diffs only in files from your feature between stage with multiple features.
#!/bin/bash
STAGING_BRANCH=staging
DEVELOP_BRANCH=develop
BRANCH_NAME=`git branch --list | fzf`
COMMON_PARENT_COMMIT_HASH=`git merge-base $BRANCH_NAME $DEVELOP_BRANCH`
FILES_LIST=`comm -12 <(git diff $BRANCH_NAME $STAGING_BRANCH --name-only) <(git diff $COMMON_PARENT_COMMIT_HASH $BRANCH_NAME --name-only)`
function diff_or_die {
if [ -z $1 ]; then
exit
BRANCH_NAME=feature/BACK-581-automatic-bills-generation-sverka
BASE_BRANCH=develop
TMP_DIR=/tmp/extractor/
EXTRACTED_FILES_LIST_FILE=$TMP_DIR/extracted_files.list
FULL_FILES_LIST_FILE=$TMP_DIR/full_files.list
TMP_FILES_LIST_FILE=$TMP_DIR/tmp_files.list
# creating and clening the temp folder
@in8finity
in8finity / offences_on_file.rb
Last active September 19, 2019 19:53
Extract offences on lines changed in branch
#!/usr/bin/env ruby
def exec_rubocop(file_name)
response = %x{rubocop -c ./.rubocop.yml #{file_name}}
response = response.split("\n")
response.grep(/\d*:\d*/)
end
def commits_to_load
%x{git log --format=format:%h $(git merge-base HEAD develop)..HEAD}.split("\n")