You know how, in JavaScript, we can set a value to a variable if one doesn't, like this:
name = name || 'joe';
This is quite common and very helpful. Another option is to do:
name || (name = 'joe');
You know how, in JavaScript, we can set a value to a variable if one doesn't, like this:
name = name || 'joe';
This is quite common and very helpful. Another option is to do:
name || (name = 'joe');
function mail_utf8($to, $subject = '(No subject)', $message = '', $header = '') {
$header_ = 'MIME-Version: 1.0' . "\r\n" . 'Content-type: text/plain; charset=UTF-8' . "\r\n";
mail($to, '=?UTF-8?B?'.base64_encode($subject).'?=', $message, $header_ . $header);
}
<!--# link: http://learn.iis.net/page.aspx/470/importing-apache-modrewrite-rules/ --> | |
<configuration> | |
<system.webServer> | |
<rewrite> | |
<rules> | |
<!--# Turn on URL rewriting--> | |
<!--# Protect hidden files from being viewed--> | |
<!--# Protect application and system files from being viewed--> | |
<rule name="Imported Rule 9" stopProcessing="true"> | |
<match url="^(?:application|modules|system)\b.*" ignoreCase="false" /> |
//element - elemento que ao clicar, sobe ao topo automaticamente e suavamente ex: $('#subir') | |
function subirSuavemente(element){ | |
"use strict"; | |
element.click(function(event){ | |
$('html, body').animate({scrollTop:0}, 'slow'); | |
event.preventDefault(); | |
}); | |
} |
// Released under MIT license: http://www.opensource.org/licenses/mit-license.php | |
$('[placeholder]').focus(function() { | |
var input = $(this); | |
if (input.val() == input.attr('placeholder')) { | |
input.val(''); | |
input.removeClass('placeholder'); | |
} | |
}).blur(function() { | |
var input = $(this); |
function preMessage(id_input, message_input){ | |
"use strict"; | |
id_input.val(message_input); | |
id_input.focusin(function(){ | |
checkInputFormsNull($(this), message_input); | |
}); | |
id_input.focusout(function(){ | |
checkInputFormsNull($(this), message_input); |
String.prototype.trim = function () { | |
return this.replace(/^\s*/, "").replace(/\s*$/, ""); | |
}; |
var c, n, s, i, j; | |
Number.prototype.formatMoney = function(c, d, t){ | |
n = this, c = isNaN(c = Math.abs(c)) ? 2 : c, d = d === undefined ? "," : d, t = t === undefined ? "." : t, s = n < 0 ? "-" : "", i = parseInt(n = Math.abs(+n || 0).toFixed(c)) + "", j = (j = i.length) > 3 ? j % 3 : 0; | |
return s + (j ? i.substr(0, j) + t : "") + i.substr(j).replace(/(\d{3})(?=\d)/g, "$1" + t) + (c ? d + Math.abs(n - i).toFixed(c).slice(2) : ""); | |
}; |
<html> | |
<head> | |
<title>ENVIO PARA EMAIL</title> | |
</head> | |
<body> | |
<?php | |
$nome = (!empty($_GET['nome'])) ? $_GET['nome'] : false; | |
$email = (!empty($_GET['email'])) ? $_GET['email'] : false; |
-- author: Fabian Carlos | |
-- INSERT para testar as triggers | |
-- INSERT INTO "passageiros" VALUES(333, 'Fabian Carlos'); | |
-- insert into "voo" VALUES(1); | |
-- insert into "aeronaves" VALUES(1,'Boing 747'); | |
-- insert into "cidades" VALUES(1, 'Cuiabá', 'Brasil'); | |
-- insert into "aeroportos" VALUES(1, 'Aeroporto VG', 1); | |
-- insert into "assentos" VALUES(1, 'AA+'); |