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
if (!function_exists('array_rows_to_columns')) { | |
/** | |
* rows to columns. | |
* | |
* @param array $array | |
* @return array | |
*/ | |
function array_rows_to_columns(array $data) | |
{ | |
$newArray = []; |
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
#!/bin/bash | |
# This script syncs (i.e. makes git pull) on a specified directory or, se no | |
# parameter was specified, in all the subdirectories that are git projects. | |
# | |
# Usage: | |
# ./auto_sync_git.sh directory_of_my_project | |
# ./auto_sync_git.sh | |
# An alias to the git binary |
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
#!/bin/bash | |
cd /path/autosync | |
if [ ! -z "$1" ]; then | |
if [ -d $1 ] && [ $1 != "." ]; then | |
cd "$1" | |
pwd | |
git pull | |
fi | |
exit 0 | |
fi |
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
#!/bin/bash | |
switchSound() { | |
NUMBER=$(pacmd list-sinks | grep "* index" | cut -d ' ' -f 5-); | |
echo $NUMBER; | |
echo "Setting default sink to: $NUMBER"; | |
pacmd set-default-sink $NUMBER | |
pacmd list-sink-inputs | grep index | while read line | |
do | |
echo "Moving input: "; |
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 App\Support\Queries; | |
use Illuminate\Database\Query\Builder as QueryBuilder; | |
use Illuminate\Database\Eloquent\Builder as EloquentQueryBuilder; | |
use Carbon\Carbon; | |
abstract class BaseQueryBuilder | |
{ |
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("lsqlite3") | |
-- Igmar: Wanneer closen we dat DB object eigenlijk ? | |
db = sqlite3.open('/etc/asterisk/users.sqlite') | |
--CONSOLE = "Console/dsp" -- Console interface for demo | |
--CONSOLE = "DAHDI/1" | |
--CONSOLE = "Phone/phone0" | |
TRUNK = "DAHDI/G1" |
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
#!/bin/bash | |
####################### ATENCAO ######################### | |
# | |
# VI ESTA DICA EM ALGUM GIST, MAS NÃO TENHO MAIS A URL | |
# POREM EU ALTEREI PARA FAZER BACKUP DE TODAS AS BASES | |
# E ADICIONEI A QUESTÃO DE PODER ADICIONAR O USUÁRIO | |
# E EMAIL NA LINHA DE COMANDO DO git | |
# | |
######################################################### | |
#se você usar apenas usuário sem senha, use este linha abaixo |
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 App\Support\Validators\Rules; | |
use App\Support\Helpers\Dates as DateHelper; | |
class DateField | |
{ | |
/** | |
* @param string $attribute |
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 App\Exceptions; | |
use Exception; | |
use Illuminate\Http\Response; | |
use App\Exceptions\Handler as BaseExceptionHandler; | |
class WhoopsHandler extends BaseExceptionHandler { | |
/** | |
* Render an exception into a response. |
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 App; | |
use Illuminate\Database\Eloquent\Model; | |
class Post extends Model | |
{ | |
/** | |
* Array of relationships to load. |