Skip to content

Instantly share code, notes, and snippets.

View crystianwendel's full-sized avatar

Crystian Wendel Meneses Leão crystianwendel

  • Roadmaps
  • Recife
View GitHub Profile
@crystianwendel
crystianwendel / c_n_s.rb
Created March 30, 2021 15:08
Classe pra validar número do CNS / Cartão Nacional de Saúde / Cartão SUS
# frozen_string_literal: true
##
# Inspired by http://www.yanaga.com.br/2012/06/validacao-do-cns-cartao-nacional-de.html and https://github.com/fnando/cpf_cnpj
#
# @example Basic usage
#
# CNS.new("187507943600018").valid? # true
# CNS.new("187 5079 4360 0018").valid? # false
# CNS.new("187507943600010").valid? # false
@crystianwendel
crystianwendel / DBHelper.cs
Last active April 23, 2024 20:41
DB Helper Class in C#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data;
using System.Data.SqlClient;
using System.Collections.Generic;
using System.Collections.Specialized;
namespace Helpers
@crystianwendel
crystianwendel / FormAluno.php
Created November 8, 2013 14:05
Exemplo simples de conexão com o banco, e inserção e lista de uma entidade simples
<?php
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title></title>
</head>
@crystianwendel
crystianwendel / index.php
Created November 8, 2013 14:02
Exemplo beeem simples com controle de acesso para usuários autenticados.
<?php
session_start();
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title></title>
</head>
@crystianwendel
crystianwendel / 1.php
Last active December 27, 2015 04:18
Prática PHP Enunciado
<!DOCTYPE html>
<html>
<head>
<title>Página 1</title>
</head>
<body>
<h1>
<?php
echo 'Hello World!'
?>
@crystianwendel
crystianwendel / pagina5.html
Created October 18, 2013 13:47
Textarea com contagem de caracteres
<html>
<head>
<meta charset="UTF-8">
<title>Titulo</title>
<link rel="stylesheet" type="text/css" href="estilo.css"/>
<style rel="stylesheet" type="text/css">
.red {
color: red;
}
</style>
@crystianwendel
crystianwendel / pagina4.html
Created October 18, 2013 13:10
Formulário inteligente, que exibe ou esconde conteúdo baseado num check
<html>
<head>
<meta charset="UTF-8">
<title>Titulo</title>
<link rel="stylesheet" type="text/css" href="estilo.css"/>
<style rel="stylesheet" type="text/css">
.hidden {
display: none;
}
@crystianwendel
crystianwendel / index.html
Created October 11, 2013 14:32
Exercício 3
<html>
<head>
<meta charset="UTF-8">
<title>Titulo</title>
<link rel="stylesheet" type="text/css" href="estilo.css"/>
<style rel="stylesheet" type="text/css">
#popup {
width: 50px;
height: 50px;
border: 1px solid red;
@crystianwendel
crystianwendel / index.html
Created October 11, 2013 13:46
Atividade 2 javascript
<html>
<head>
<meta charset="UTF-8">
<title>Titulo</title>
<link rel="stylesheet" type="text/css" href="estilo.css"/>
<style rel="stylesheet" type="text/css">
#popup {
width: 200px;
height: 200px;
border: 1px solid red;
@crystianwendel
crystianwendel / index.html
Created October 11, 2013 12:43
Formulário com validação simples
<html>
<head>
<meta charset="UTF-8">
<title>Titulo</title>
<style rel="stylesheet" type="text/css">
input.invalid {
border: 2px solid red;
}
</style>
</head>