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 | |
/** | |
* WordPress Query Comprehensive Reference | |
* Compiled by luetkemj - luetkemj.com | |
* | |
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query#Parameters | |
* Source: https://core.trac.wordpress.org/browser/tags/3.9/src/wp-includes/query.php | |
*/ | |
$args = array( |
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
jQuery(function($) { | |
// add a handler for form submit (makes an AJAX call) | |
$(document).on('submit', 'form.my-class', myFormSubmitHandler); | |
// submit form on command + enter if in a textarea | |
$(document).on('keydown', 'body', function(e) { | |
if (!(e.keyCode == 13 && e.metaKey)) return; | |
var $target = $(e.target); | |
if ($target.is('textarea')) { |
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
#!/usr/bin/perl -w | |
# | |
## Copyright (C) 2011 Colin Mollenhour <http://colin.mollenhour.com/> | |
## | |
## This program is free software; you can redistribute it and/or | |
## modify it under the terms of the GNU General Public License | |
## as published by the Free Software Foundation; version 2 dated June, | |
## 1991. | |
## |
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 Obras\Bundle\CadastroBundle\Validator\Constraints; | |
use Symfony\Component\Validator\Constraint; | |
/** | |
* @Annotation | |
* @Target({"PROPERTY", "METHOD", "ANNOTATION"}) | |
* |
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 | |
// ... | |
$this->addElementPrefixPath('My_Validate', 'My/Validate/', 'validate'); | |
$this->addElement('text', 'start_time', array( | |
'label' => 'Start Time (GMT)', | |
'class' => 'datetime', | |
'required' => true, | |
'validators' => array( |
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
/* | |
verifica_cpf_cnpj | |
Verifica se é CPF ou CNPJ | |
@see http://www.tutsup.com/ | |
*/ | |
function verifica_cpf_cnpj ( valor ) { | |
// Garante que o valor é uma string |
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
DELIMITER $$ | |
CREATE FUNCTION CAP_FIRST (input VARCHAR(255)) | |
RETURNS VARCHAR(255) | |
DETERMINISTIC | |
BEGIN | |
DECLARE len INT; | |
DECLARE i INT; |
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 Meu\AppBundle\EventListener; | |
use Oneup\UploaderBundle\Event\PostPersistEvent; | |
class UploadListener | |
{ | |
protected $service; |
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
// ########################################################################### // | |
// ########################################################################### // | |
// - Truncate - // | |
// ########################################################################### // | |
// ########################################################################### // | |
/** | |
* Truncate Filter | |
* @Param text | |
* @Param length, default is 10 | |
* @Param end, default is "..." |
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
// ########################################################################### // | |
// ########################################################################### // | |
// - Html2Plaintext - // | |
// ########################################################################### // | |
// ########################################################################### // | |
define( | |
[ | |
'app', | |
], | |
function(app) { |