View limpar campos
$('form').submit(function(){
$(this)[0].reset();
});
View HTML
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
<form id="myform" method="post">
<input type="text" id="nome" name="nome" placeholder="nome">
View isOnScreen
function isOnScreen(el) {
var win = $(window);
var winTop = win.scrollTop();
var winBottom = winTop + win.height();
var elTop = el.offset().top;
var elBottom = elTop + el.height();
return winTop <= elBottom && winBottom >= elTop;
View modal.css
* { margin: 0; padding: 0; }
.content-modal {
width: 800px;
height: 400px;
background: #fff;
margin-left: -400px;
margin-top: -200px;
position: absolute;
left: 50%;
View java.criptografia
import java.math.BigInteger;
import java.security.*;
public static void main(String[] args) {
String texto = "admin";
Criptografar(texto);
}
public static void Criptografar(String str) {
try {
View java.regex
import java.util.regex.*;
public static void main(String[] args) {
String texto = "_Java Netbeans_";
String regex = "[\\W_]"; // Expressao Regular ([\W_] = Não é permitido caracter especial)
Pattern p = Pattern.compile(regex);
if(!"".equals(texto)) {
for(int i = 0; i < texto.length(); i++) {
char c = texto.charAt(i);
String conversao = Character.toString(c);
View sqlserver.conexao
import java.sql.*;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JOptionPane;
public class Connect {
public Statement stm; // Responsavel por preparar e realizar pesquisas no banco de dados;
public ResultSet rs; // Responsavel por armazenar o resultado de um pesquisa passada para o statement;
private String driver = "com.microsoft.sqlserver.jdbc.SQLServerDriver";
private String caminho = "jdbc:sqlserver://localhost:1433;databaseName=control"; // O "control" representa a minha database
View postgresql.biblioteca
Bibliotecas > Adicionar Biblioteca > Driver JDBC do PostgreSQL
View javascript.imageFullResize
function setDimensions(){
var windowsWidth = $(window).width();
$('.content img').css('width', windowsWidth + 'px');
}
$(document).ready(function() {
setDimensions();
});
$(window).resize(function() {
View @font-face
http://www.fontsquirrel.com/tools/webfont-generator
@font-face {
font-family: 'NewJuneRegular';
src: url('fonts/regular/newjuneregular-webfont.eot');
src: url('fonts/regular/newjuneregular-webfont.eot?#iefix') format('embedded-opentype'),
url('fonts/regular/newjuneregular-webfont.woff2') format('woff2'),
url('fonts/regular/newjuneregular-webfont.woff') format('woff'),
url('fonts/regular/newjuneregular-webfont.ttf') format('truetype'),
url('fonts/regular/newjuneregular-webfont.svg#newjuneregularregular') format('svg');