This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
################################### | |
# PS1 color for .bashrc file | |
# | |
# curl -Ls https://gist.github.com/andkirby/389f18642fc08d1b0711d17978445f2b/raw/bashrc_ps1_install.sh | bash | |
# curl -Ls https://bit.ly/bash-ps1 | bash | |
################################### | |
touch ~/.bashrc | |
if ! cat ~/.bashrc | grep '# Colorize PS1 console' > /dev/null; then | |
echo >> ~/.bashrc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# t_color COLOR_NO MESSAGE [STYLE_NO] | |
t_color () { | |
local style | |
style=$([ -n "$3" ] && echo 0 || echo $3) | |
echo -e '\e['$3';'$1'm'$2'\e[0m' | |
} | |
t_warning () { | |
echo -e '\e[0;33m'$1'\e[0m' | |
} | |
t_ok () { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Download this file in Windows GitBash | |
# curl -Ls https://gist.github.com/andkirby/cbeaad9fbedcbce6cf20bf5ba5467e59/raw/sscp -o /usr/bin/sscp | |
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | |
readonly SCRIPT_DIR | |
show_help () { | |
echo -e " |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'yaml' | |
require 'digest/md5' | |
## | |
# Module VBoxDirectPorts | |
# It add ports forwarding in VirtualBox VM | |
# It can generate ports based upon hostname | |
# | |
# Configuration files. | |
# (.dist) means there is should be distributive file by default with default configuration |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# This script can install NodeJS and NPM on Windows | |
# Run this command in GitBash Windows console to get latest version: | |
# | |
# $ curl -Ls https://gist.github.com/andkirby/raw/node-npm-git-bash-win.sh | bash | |
# | |
# Last update: 2022-04-29 | |
set -o errexit | |
set -o pipefail |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0"?> | |
<config> | |
<global> | |
<session_save><![CDATA[memcached]]></session_save> | |
<session_save_path><![CDATA[127.0.0.1:11211?persistent=0&weight=2&timeout=10&retry_interval=10]]></session_save_path> | |
<cache> | |
<backend>Mage_Cache_Backend_Redis</backend> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
############################################################################### | |
# !!!!!!!!!! This script is deprecated, but you may continue use it. !!!!!!!! # | |
# Actually, it doesn't contain a code. It migrated into a repository. # | |
# Please take a look at https://github.com/rikby/xdebug-switcher # | |
############################################################################### | |
# | |
# Download this gist into file "~/.xd_swi" | |
# curl -Ls https://goo.gl/IxjlaC | bash | |
# or |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace PHPSTORM_META { // we want to avoid the pollution | |
/** @noinspection PhpUnusedLocalVariableInspection */ | |
/** @noinspection PhpIllegalArrayKeyTypeInspection */ | |
$STATIC_METHOD_TYPES = [ | |
\Symfony\Component\Console\Command\Command::getHelper('') => [ | |
'question' instanceof \Symfony\Component\Console\Helper\QuestionHelper, | |
'process' instanceof \Symfony\Component\Console\Helper\ProcessHelper, | |
'debug_formatter' instanceof \Symfony\Component\Console\Helper\DebugFormatterHelper, | |
'descriptor' instanceof \Symfony\Component\Console\Helper\DescriptorHelper, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$a = new ArrayIterator; | |
$a->append(++$cnt); | |
$a->append(++$cnt); | |
foreach ($a as $i => $item) { | |
$cnt < 5 && $a->append(++$cnt); | |
var_dump($item); | |
} | |
//int(1) | |
//int(2) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# This script can send Magento 1.x exception messages to Slack | |
# | |
# This file can be added to the root of a project | |
# Please be sure that you have a file var/log/exception.log in your project | |
# | |
# Run this file in background via command with "&" in the end | |
# $ slack-log-monitor.sh [OPTIONS] & | |
# See more options by command: $ slack-log-monitor.sh --help |