Skip to content

Instantly share code, notes, and snippets.

View rssilva's full-sized avatar

Rafael Specht da Silva rssilva

View GitHub Profile
var n = 10
var C = function () {
this.s = function (a, b) {
return a + b
}
//Os eventos 'pageinit' e 'pagecreate' são chamados
//quando exibimos uma página pela primeira vez...
//vamos criar um objeto chamado app
var app = {};
$(document).bind('pageinit', function (ev) {
//toda vez que chamarmos esse novo evento
//checaremos se a propriedade 'loaded'
//existe e é verdadeira. Caso contrário instanciamos
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Page Title</title>
<link rel="stylesheet" href="lib/jquery.mobile-1.3.0/jquery.mobile-1.3.0.css" />
<script type="text/javascript" src="lib/jquery-1.8.3.js"></script>
<script type="text/javascript" src="lib/jquery.mobile-1.3.0/jquery.mobile-1.3.0.min.js"></script>
<script type="text/javascript" src="js/transition-test.js"></script>
</head>
//aqui temos o json com dados que devemos exibir para o usuário
var employeesListByCompany = [
{
name: 'Death Star',
employees: [
{
name: 'Darth Vader',
email: 'lukesfather@deathstar.com'
},
@rssilva
rssilva / index.html
Last active December 16, 2015 05:39
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Teste COM Templates</title>
<style type="text/css">
.employee-name {
list-style: none;
}
.employee-data {
list-style: none;
@rssilva
rssilva / index.html
Last active December 16, 2015 05:39
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Teste SEM template</title>
<style type="text/css">
.employees {
list-style: none;
}
.employee-data {
list-style: none;
//Aqui temos o json que poderíamos receber do back-end
//uma lista de empresas que tem uma lista de funcionários
//que tem nome e email
var employeesListByCompany = [
{
name: 'Death Star',
employees: [
{
name: 'Darth Vader',
email: 'lukesfather@deathstar.com'
describe('MatrizEspiral', function () {
it ('Deve retornar uma matriz espiral que incrementa no sentido horário', function () {
var response = []
response[0] = [ 1, 2, 3];
response[1] = [10, 11, 4];
response[2] = [ 9, 12, 5];
response[3] = [ 8, 7, 6];
expect(MatrizEspiral(3, 4)).toEqual(response);
describe('PrimeFactor', function () {
it ('Deve retornar um array com a decomposicao em fatores primos', function () {
expect(primeFactor(100)).toEqual([2, 2, 5, 5]);
expect(primeFactor(2)).toEqual([2]);
expect(primeFactor(12)).toEqual([2, 2, 3]);
//Quando a página tiver sido carregada...
window.onload = function () {
//atribuímos um evento de click ao botão.
//Ao clicar, chamamos a função 'change'
$('#changeClass').on('click', function () {
change();
});