O JavaScript possui uma série de curiosidades em relação a algumas instruções. Portanto, tome cuidado se precisar utilizar qualquer uma dessas instruções listadas abaixo.
0.1 + 0.2 == 0.3 // false
1 / 0 // Infinity
$('#percent').mask('P', { | |
translation: { | |
'P': { | |
pattern: /[\d\.,]/, | |
recursive: true | |
} | |
}, | |
onKeyPress: function(val, e, field, options) { | |
var old_value = $(field).data('oldValue') || ''; |
DELIMITER $$ | |
USE `database` $$ | |
DROP TRIGGER IF EXISTS `set_uuid` $$ | |
CREATE DEFINER = CURRENT_USER | |
TRIGGER `set_uuid` | |
BEFORE INSERT ON `table` | |
FOR EACH ROW | |
BEGIN |
<?php | |
function get_week_by_date($date) { | |
$date = strtotime($date); | |
$week_position = date('w', $date); | |
// Seeking sunday | |
$sunday = ($week_position == 0) ? $date : strtotime('last sunday', $date); |
<?php | |
function translate_similar_chars($buffer) { | |
$single_double = array( | |
'Æ' => 'AE', | |
'æ' => 'ae' | |
); | |
$buffer = strtr( | |
$buffer, |