Skip to content

Instantly share code, notes, and snippets.

View caioerick's full-sized avatar

Caio Erick caioerick

View GitHub Profile
<?php
$idade = 15;
function validar($email) {
if($idade > 18) {
return true;
}
else {
return false;
<?php
$a = Array("Caio", " Erick", " Braga", " Costa");
echo $a[0].$a[1].$a[2].$a[3]; // Imprimindo meu nome
for($i=0;$i<4;$i++) {
echo $a[$i];
}
@caioerick
caioerick / guia-de-fontes.html
Created June 2, 2014 02:34
Guia de fontes estilizadas da biblioteca de fonts do Google
<!DOCTYPE html>
<htm>
<head>
<link href="//fonts.googleapis.com/css?family=Abril+Fatface|Open+Sans:300italic,600italic,300,600|Quando|Josefin+Slab:400,700,400italic,700italic|Trocchi|Arvo|Lato:300,400,700,300italic,400italic,700italic|Raleway:200,300,700|Playfair+Display:400,700,400italic,700italic|Bitter:400,700,400italic|Vollkorn:400,400italic&amp;subset=latin,latin-ext" media="screen" rel="stylesheet" type="text/css">
</head>
<body>
<div style="font-family: 'Open Sans'; font-size: 20px;">Caio Erick Braga Costa</div>
<div style="font-family: 'Raleway'; font-size: 20px;">Caio Erick Braga Costa</div>
</body>
</html>
@caioerick
caioerick / booble-sort.php
Created June 2, 2014 02:40
Booble Sort em PHP
<?php
$vet[5] = Array(1, 3, 5, 2, 4);
for($i=0;$i<5;$i++) {
for($j=0;$j<4;$j++) {
if($vet[$j] > $vet[$j+1]) {
$aux = $vet[$j];
$vet[$j] = $vet[$j+1];
$vet[$j+1] = $aux;
}
@caioerick
caioerick / parallax.html
Created June 2, 2014 02:42
Efeito Parallax em HTML / CSS / JavaScript - Background movendo lentamente ao rolar a página.
<html>
<head>
<title>Backgruound movendo lentamente</title>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$('div.bgParallax').each(function(){
var $obj = $(this);
$(window).scroll(function() {
@caioerick
caioerick / CPBR
Created June 2, 2014 02:51
Vídeos da Campus Party Brasil
CPBR6 - Modelo de Negócios em negócios tradicionais e digita
http://www.youtube.com/watch?v=3genjz_g0Gc
CPBR6 - Como ganhar dinheiro com Apps
http://www.youtube.com/watch?v=MGZrR3vxwQ4
CPBR6 - Desenvolvimento Orientado a Testes
http://www.youtube.com/watch?v=MJ1SRtZXPr0
CPBR6 - De pequenas startups a grandes negócios
@caioerick
caioerick / sudoku
Created June 2, 2014 03:09
Algoritimo que gera uma grade de sudoku válida em PHP
<?php
function return_row($cell){
return floor($cell/9);
}
function return_col($cell){
return $cell % 9;
}
<?php
$string = "Computação";
diminuiString($string, 8);
function diminuiString($string, $tamanho) {
$maximo = $tamanho;
if(strlen($string) < $maximo) {
echo $string;
}
else {
@caioerick
caioerick / BarcodeQR.class.php
Created May 18, 2013 03:32
Generate QR Code with PHP Class.
<?php
/**
* BarcodeQR - Code QR Barcode Image Generator (PNG)
*
* @package BarcodeQR
* @category BarcodeQR
* @name BarcodeQR
* @version 1.0
* @author Shay Anderson 05.11
* @link http://www.shayanderson.com/php/php-qr-code-generator-class.htm
package br.com.aplicativo.app;
package view;
import android.app.Activity;
public class MainActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {