Skip to content

Instantly share code, notes, and snippets.

View davialexandre's full-sized avatar

Davi Alexandre davialexandre

View GitHub Profile
function hrcore_civicrm_config($config) {
$defaultTimeout = 100000;
// get the timeout from settings or use the default one
$timeout = $config->get('session.timeout', $defaultTimeout);
ini_set('session.gc_maxlifetime', $timeout);
ini_set('session.cookie_lifetime', $timeout);
}
@davialexandre
davialexandre / civibuildcd.sh
Created September 3, 2018 12:47
civibuildcd
function civibuildcd {
DEST=$(civibuild show $1 | grep -o -e "CMS_ROOT: .*" | cut -d' ' -f 2)
if [ -d "$DEST" ]; then
cd $DEST
else
echo "No folder found for $1"
fi
}
"husky": {
"hooks": {
"pre-commit": "cd .. && vendor/bin/psalm && vendor/bin/phpcs"
}
}
vagrant@civihr-upgrade:/vagrant/civihr/sites/all/modules/civicrm/tools/extensions/civihr/uk.co.compucorp.civicrm.hrcore$ phpunit4 --testsuite "Unit Tests"
PHPUnit 4.8.21 by Sebastian Bergmann and contributors.
............................................................... 63 / 153 ( 41%)
............................................................... 126 / 153 ( 82%)
...........................
Time: 1.12 minutes, Memory: 105.50Mb
OK (153 tests, 351 assertions)

Keybase proof

I hereby claim:

  • I am davialexandre on github.
  • I am davialexandre (https://keybase.io/davialexandre) on keybase.
  • I have a public key ASDiHk4XycfbGyPgWof9lRsGksMBMtWHcIT-TIa7jm6MqQo

To claim this, I am signing this object:

@davialexandre
davialexandre / gerador-cpf.sh
Created October 5, 2012 22:49
Script bash gerador de CPF
#!/bin/bash
SOMA=0
for i in {10..2}
do
NUMERO=$((`cat /dev/urandom|od -N1 -An -i` % 9))
CPF=$CPF$NUMERO
SOMA=$(($SOMA+($NUMERO*$i)))
done
RESTO=$(($SOMA%11))
if [ $RESTO -lt 2 ]
@davialexandre
davialexandre / gruvbox_dark.json
Created June 23, 2019 18:09
Gruvbox Dark color scheme for the new Windows Terminal
{
"background" : "#282828",
"black" : "#282828",
"blue" : "#458588",
"brightBlack" : "#928374",
"brightBlue" : "#83A598",
"brightCyan" : "#8EC07C",
"brightGreen" : "#B8BB26",
"brightPurple" : "#D3869B",
"brightRed" : "#FB4934",