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
/** | |
* Em desenvolvimento. | |
* Objeto para gerenciar uma | |
*conexão ao banco de dados Mysql | |
* @author Igor | |
*/ | |
class db { | |
private $dsn; | |
private $username; | |
private $password; |
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
$(function() { | |
timeout = setTimeout(function() { | |
window.location.href = "http://google.com"; | |
}, 2500);//waiting 2,5s | |
}); | |
$(document).on('mousemove', function() { | |
if (timeout !== null) { | |
clearTimeout(timeout); | |
} |
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 | |
//This class creates a connection with the databse and generates log files | |
class db { | |
public static $dsn; | |
public static $username; | |
public static $password; | |
public static $db; | |
public static $conn; | |
public static $arrConnAttr;//Array of connection attributes. Ex: ["PDO::ATTR_ERRMODE", "PDO::ERRMODE_EXCEPTION"] |
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
spl_autoload_register(function ($class_name) { | |
include './class/'.$class_name . '.php'; | |
}); | |
================== or ======================== | |
function __autoload($className) { | |
$className = str_replace("..","", $className); | |
require_once ("./class/$className.php"); | |
} |
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
//Eu tenho a seguinte string que representa um código html gerado dinamicamente por php. | |
//Preciso filtrar novas linhas e espaços em brancos para ser formatado corretamente num string JSON para | |
//Ser enviado através de AJAX. | |
<ul class="list-group sidebar-nav-v1 margin-bottom-40" id="menuHomeUserPrivate"> | |
<li class="list-group-item active"> | |
<a id="to_ProfileOverall" class="privateMenuLinkJS"><i class="fa fa-bar-chart-o"></i> Overall</a> | |
</li> | |
<li class="list-group-item list-toggle"> | |
<a data-toggle="collapse" data-parent="#menuHomeUserPrivate" href="#collapse-MoneyManage" ><i class="fa fa-money"></i> Invoice</a> |
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
<script> | |
$(function(){ | |
$('head').append('<link href="someFile.css" rel="stylesheet">'); | |
}); | |
</script> |
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
$('.rdShipMo').on( 'click', function() { | |
$('input:radio[class=rdShipMo]').each(function() {//Passar por cada radio da classe rdShipMo | |
if ($(this).is(':checked')) { | |
var idVal = $(this).attr("id"); | |
alert($("label[for='"+idVal+"']").text()); | |
} | |
}); | |
}); | |
https://jsfiddle.net/a5Lu0orb/1/ |
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
//Inserir o link para jQuery, js.bootstrap e css.bootstarp. | |
//O CSS exclusivo do tooltip está separado logo abaixo. | |
<textarea id='addItInfo' rows='4' cols='65%' name='prf[info][nm_additionalItInfo]' data-toggle='tooltip' data-placement='left'>$nm_additionalItInfo</textarea> | |
if($('#addItInfo').val()==''){ | |
//alert("Must to fill the field 'REASON TO PRF REQUEST'"); | |
//return false; | |
var msg ="Oops! This field must to be filled"; |
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
http://lamberta.github.io/html5-animation/ | |
https://jsfiddle.net/ynj2kqmk/ | |
https://jsfiddle.net/1wu1x8zj/ | |
https://github.com/lamberta/html5-animation | |
//https://css-tricks.com/guide-svg-animations-smil/ | |
<canvas id="canvas" width="400" height="400"></canvas> |
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
http://888hack.com/2016/06/04/integracao-arduino-php-pelo-ubuntu/ | |
CÓDIGO PHP | |
<?php | |
$porta = '/dev/ ttyACM0'; | |
$numeroLido = $_REQUEST["numero"]; | |
echo "Numero lido: $numeroLido"; | |
$conexaoArduino = fopen($porta, 'w'); | |
fwrite($conexaoArduino, $_REQUEST["numero"]); | |
fclose($conexaoArduino); |