View resources.md

https://mailtrap.io/

Mailtrap is a solution that allows testing email notifications without sending them to the real users of your application.


https://www.twilio.com/

Enabling phones, VoIP, and messaging to be embedded into web, desktop, and mobile software.

View .functions.sh
# Yii2 Command Line
yii() {
if [[ $1 == "generate" || $1 == "make" ]]; then
case "$2" in
"controller") command php yii gii/controller ${@:3} ;;
"crud") command php yii gii/crud ${@:3} ;;
"extension") command php yii gii/extension ${@:3} ;;
"form") command php yii gii/form ${@:3} ;;
"model") command php yii gii/model ${@:3} ;;
"module") command php yii gii/module ${@:3} ;;
View system-info-sh
#!/usr/bin/bash
# ==============================================================================
# Get general information
# ==============================================================================
# Get hostname
HOSTNAME=`hostname` 2> /dev/null
# Get distro
View current-cpu.sh
#!/usr/bin/bash
echo `top -bn1 | grep "%Cpu(s)" | \
sed "s/.*, *\([0-9.]*\)%* id.*/\1/" | \
awk '{print "{ \"used\": " $1 ", \"free\": " 100-$1" }" }'`
`
View current-memory.sh
#!/usr/bin/bash
# References:
# - Calculations: http://zcentric.com/2012/05/29/mapping-procmeminfo-to-output-of-free-command/
memInfo=`cat '/proc/meminfo' | grep 'MemTotal\|MemFree\|Buffers\|Cached'`
# Get total memory and convert it to MB or GB
total=`echo $memInfo | awk '{ if ($2 > 1024**2) { $2=$2 / 1024 ** 2; $3="GB"; } else if ($2 > 1024) {$2=$2 / 1024; $3="MB"; } $2=sprintf("%.2f", $2); print $2 " " $3 }'`
View ruleset.xml
<?xml version="1.0" encoding="UTF-8"?>
<ruleset name="Cayetano">
<description>
The coding standard of the Cayetano team, based on the Generic, PSR2,
Squiz and Zend coding standards.
</description>
<!-- Exclude git -->
<exclude-pattern>*/.git/*</exclude-pattern>
View git-hook
#!/usr/bin/env bash
git config --global init.templatedir '~/.git-templates'
mkdir -p ~/.git-templates/hooks
cat > ~/.git-templates/hooks/post-merge <<EOL
#!/usr/bin/env bash
DIR="\$( cd "\$( dirname "\${BASH_SOURCE[0]}" )" && pwd )"
View post-merge
#/usr/bin/env bash
# MIT © Sindre Sorhus - sindresorhus.com
# forked by Gianluca Guarini
changed_files="$(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD)"
check_run() {
echo "$changed_files" | grep -E --quiet "$1" && eval "$2"
}
View tell-time-every-hour.vbs
Dim speaks, speech
speaks = "It's " & hour(time) & " o'clock"
Set speech = CreateObject("sapi.spvoice")
speech.Speak speaks
View make-certificate.sh
#!/bin/bash
printf "\n"
commands=(makecert certutil pvk2pfx)
for i in "${commands[@]}"
do
command -v $i >/dev/null && continue || {
echo "ERROR: $i command not found.";