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 | |
/* Dependencias instaladas com composer | |
{ | |
"require" : { | |
"knplabs/knp-snappy": "*", | |
"h4cc/wkhtmltopdf-amd64": "0.12.x", | |
"h4cc/wkhtmltoimage-amd64": "0.12.x" | |
} | |
} |
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 | |
printMessage () { | |
if [ $# -eq 0 ]; then | |
echo "Usage: printMessage MESSAGE [printMessage_CHARACTER]" | |
return 1 | |
fi | |
echo "" | |
echo "" | |
printf -v _hr "%*s" 80 && echo -en ${_hr// /${2--}} && echo -e "\r\033[2C$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
git config --global alias.lg "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit" |
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(['modules/banners/views/listaView'], function (EmailModal) { | |
var view = new EmailModal({model: new Backbone.Model()}), | |
modalOptions = { | |
removeExtraPannel: true, | |
showFooter: true, | |
title: 'Responder e-mail', | |
modalSize: 'full', // renderiza .modal-lg | |
onRenderCallback: function () { | |
console.log('Execuntando o método onRenderCallback'); | |
} |
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/sh | |
PROJECT=`php -r "echo dirname(dirname(dirname(realpath('$0'))));"` | |
STAGED_FILES_CMD=`git diff --cached --name-only --diff-filter=ACMR HEAD | grep \\\\.php` | |
CODESNIFER_RUNS=0 | |
# Determine if a file list is passed | |
if [ "$#" -eq 1 ] | |
then | |
oIFS=$IFS |
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 | |
$pdo = new PDO('mysql:host=localhost;dbname=itlean', $this->db->username, $this->db->password); | |
$username = 'itlean'; | |
$consulta = $pdo->prepare("SELECT * FROM admin_users WHERE username = :username;"); | |
$consulta->bindParam(':username', $username, PDO::PARAM_STR); | |
$consulta->execute(); | |
while ($linha = $consulta->fetch(PDO::FETCH_OBJ)) { |
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
(function ($) { | |
$.fn.onlyNumbers = function () { | |
return this.each(function () { | |
$(this).keydown(function (e) { | |
// backspace, delete, tab, escape, enter and . | |
if ($.inArray(e.keyCode, [46, 8, 9, 27, 13, 110, 190]) !== -1 || | |
// Ctrl+A, Command+A |
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 | |
printMessage () { | |
if [ $# -eq 0 ]; then | |
echo "Usage: printMessage MESSAGE [printMessage_CHARACTER]" | |
return 1 | |
fi | |
echo "" | |
echo "" | |
printf -v _hr "%*s" 80 && echo -en ${_hr// /${2--}} && echo -e "\r\033[2C$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
<?php | |
$var = "yes"; | |
var_dump(filter_var($var, FILTER_VALIDATE_BOOLEAN)); | |
# A saída do código acima seria: | |
# bool(true) | |
?> |
OlderNewer