This file contains hidden or 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
| String.prototype.toSlug = function(){ | |
| str = this.replace(/^\s+|\s+$/g, ''); // trim | |
| str = str.toLowerCase(); | |
| // remove accents, swap ñ for n, etc | |
| var from = "ãàáäâèéëêìíïîõòóöôùúüûñç·/_,:;"; | |
| var to = "aaaaaeeeeiiiiooooouuuunc------"; | |
| for (var i=0, l=from.length ; i<l ; i++) { | |
| str = str.replace(new RegExp(from.charAt(i), 'g'), to.charAt(i)); | |
| } |
This file contains hidden or 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 | |
| function send_error($str = '') { | |
| if (getEnvironment() == 'production') { | |
| $return = null; | |
| // Configuração de dados SMTP, a gosto do programador | |
| $Settings = array('auth' => 'login', | |
| 'ssl'=> 'ssl', | |
| 'port'=> '465', | |
| 'username' => '[email protected]', |
This file contains hidden or 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 | |
| function fibb($limit = 1, $first_number = 0, $second_number = 1) { | |
| if ($limit <= 0) { | |
| exit('End'); | |
| } | |
| echo $second_number."\n"; | |
| fibb($limit-1, $second_number, ($first_number + $second_number)); | |
| } |
This file contains hidden or 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
| register_shutdown_function( "fatal_handler" ); | |
| function send_error($str = '') { | |
| $Settings = array('auth' => 'login', | |
| 'ssl'=> 'ssl', | |
| 'port'=> '465', | |
| 'username' => 'username', | |
| 'password' => 'pass'); | |
| $transport = new Zend_Mail_Transport_Smtp('smtp.email.com',$Settings); |
This file contains hidden or 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
| // Convert Mapping | |
| ./vendor/doctrine/doctrine-module/bin/doctrine-module orm:convert-mapping --namespace="Application\\Entity\\" --force --from-database annotation ./module/Application/src/ | |
| // Add methods | |
| ./vendor/doctrine/doctrine-module/bin/doctrine-module orm:generate-entities ./module/Application/src/ --generate-annotations=true |
This file contains hidden or 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
| DROP FUNCTION IF EXISTS `format_sku`; | |
| DELIMITER // | |
| CREATE FUNCTION `format_sku`(`str` TEXT) | |
| RETURNS text | |
| LANGUAGE SQL | |
| DETERMINISTIC | |
| NO SQL | |
| SQL SECURITY INVOKER | |
| COMMENT '' |
This file contains hidden or 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
| // Adding counter | |
| db.counters.insert( | |
| { | |
| _id: "userid", | |
| seq: 0 | |
| } | |
| ); | |
| // function to add sequence | |
| function getNextSequence(name) { |
NewerOlder