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 | |
# * * * * * /bin/sh cronjob.sh "Teste 1 2 3" | |
{ | |
PID=$(/usr/bin/pgrep gnome-session) | |
dbus=$(/bin/grep -z DBUS_SESSION_BUS_ADDRESS /proc/$PID/environ|cut -d= -f2-) | |
export DBUS_SESSION_BUS_ADDRESS=$dbus | |
DISPLAY=:0.0 /usr/bin/notify-send --urgency=critical "Alert using crontab" "$1" | |
} >> $HOME/crontab/alert.log 2>&1 |
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
package main | |
import "os" | |
import "fmt" | |
import "math" | |
import "strconv" | |
func main() { | |
number, _ := strconv.ParseFloat(os.Args[1:2][0], 64) | |
denom := float64(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
<?php | |
$diff = array_diff_assoc(array(array('dsa' => '2')), array(array(),array())); | |
if (count($diff)) { | |
print_r($diff); | |
} | |
echo '<br />Gerou um "PHP Notice: Array to string conversion" na linha 3'; | |
echo '<br />----'; |
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 | |
$request = $e->getRequest(); | |
$needHttps = (preg_match($listNeedHttps, $request->getRequestUri()) != false); | |
$isHttps = ($request->getUri()->getScheme() == 'https'); | |
$isGetMethod = ('GET' == $request->getMethod()); | |
$url = new Http($request->getUri()); | |
if ($needHttps and !$isHttps and $isGetMethod) { | |
$url->setScheme('https'); |
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 [ $# -eq 0 ] | |
then | |
echo "C'mmon! Specific new branch, please!" | |
else | |
echo "~ git pull composer" | |
git pull composer | |
echo "~ git pull origin" | |
git pull origin |
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 | |
$txt = array( | |
'08 11', | |
'08110054 00432 0000 15 27 4597 00 065001017', | |
'08110629 00017 0000 I 4597 1528 00 4597', | |
'08110641 00015 0000 J 4597 4595 00 4597', | |
'08110643 00005 0000 J 4595 4597 00 4595', | |
'08110647 00008 0000 J 4595 4597 00 4595', | |
'08110713 01058 0000 I 4597 1528 00 4597', |
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 | |
class Teste { | |
public $outro; | |
function __construct($outraclasse) { | |
$this->outro = $outraclasse; | |
} | |
} | |
class Loader { |
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 Site\Controller; | |
use Respect\Validation\Validator as v; | |
class FormController extends BaseController | |
{ | |
public function faleAction() |
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
apt-get -y -q install make g++ flex bison build-essential zlib1g-dev binutils \ | |
cmake automake autoconf libmcrypt-dev libmhash-dev libxslt1-dev \ | |
libtidy-dev libbz2-dev libxml2-dev libssl-dev curl vim git perl \ | |
libpng12-dev libpng12-0 libpng3 libjpeg62 libjpeg62-dev libxpm-dev libpcre3 \ | |
libpcre3-dev zlib1g zlib1g-dev libltdl-dev libltdl7 pkg-config \ | |
libcurl4-openssl-dev libfreetype6 libfreetype6-dev libc-client2007e \ | |
libc-client2007e-dev libkrb5-3 libkrb5-dev openssl \ | |
libcurl4-openssl-dev libicu-dev libpspell-dev curl-dev \ | |
linux-libc-dev libc-dev-bin libc-bin libc-client2007e-dev eglibc-source \ | |
libkrb5-3 libkrb5-dev libkrb53 libkrb5support0 libncurses5-dev libncurses5 \ |
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 | |
$list = array( | |
array( | |
'idCliente' => 12, | |
), | |
array( | |
'idCliente' => 2, | |
), | |
array( |