Skip to content

Instantly share code, notes, and snippets.

View crissilvaeng's full-sized avatar

Cristina Silva crissilvaeng

View GitHub Profile
@crissilvaeng
crissilvaeng / admin.c
Last active August 29, 2015 14:05
Shire Subway Sustem - Admin
#include <stdio.h> //Pre-processor: Inclui biblioteca necessaria
#include <string.h> //Necessaria para o strcpy
#define ERROR_OPEN NULL
typedef struct //Cria tipo definido para estação
{
char name[12]; //Char de 12 posições para armazenar o nome
int distance; //Inteiro para armazenar quilometros para a proxima estação
} tp_station;
@crissilvaeng
crissilvaeng / AcademicSystem.c
Last active August 29, 2015 14:06
Academic System : Infnet Instituion
/*
* Cristina Silva <cristina.silva@openmailbox.org>
* GNU Public License
*/
#include <stdio.h>
#include <stdbool.h>
#include <string.h>
#include <ctype.h>
@crissilvaeng
crissilvaeng / ponteiro.c
Last active August 29, 2015 14:09
Demonstrando as magicas de um asterisco
/*
* ponteiro.c
*
* Copyright 2014 Cristina Silva <cristina.silva@openmailbox.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
@crissilvaeng
crissilvaeng / error.h
Last active August 29, 2015 14:13
C Coding Style
#define SUCCESS 0
#define NULL_ARGS 1
#define NULL_PARAM -1
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#define T_STRING 50
// monta um registro de um aluno
struct Aluno{
char nome[T_STRING];
int nota[3];
float media;
};
@crissilvaeng
crissilvaeng / index.html
Created February 21, 2015 23:27
Bootstrap's Default Page
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <!-- IE, sempre o IE -->
<meta name="viewport" content="width=device-width, initial-scale=1">
<title><!-- My title stay here! --></title>
<link rel="stylesheet" type="text/css" href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css">
@crissilvaeng
crissilvaeng / manipula.py
Created June 25, 2015 19:06
[UFRJ] Prova Unificada de Computação I - Segunda Prova - 28/05/14 - Questão 03
#Declara função manipula que recebe listas que é uma lista de listas
#Por exemplo: listas = [['abaxai', 'goiaba', 'banana'], ['gol', 'celta', 'picasso'], ['cachorro', 'mamute', 'gato']]
def manipula(listas):
#Inicializa uma lista vazia
res = []
#Inicia um laço de for que vai desde 0 até a última casa de listas
for i in range(len(listas)): #A função len(listas) retorna o tamanho de listas. Exemplo: len(['cachorro', 'mamute', 'gato']) = 3
#Coloca numa variavel um elemento de listas indicado pelo indice i
lista = listas[i] # Por exemplo: lista = ['gol', 'celta', 'picasso']
#Testa se o tamanho de lista é igual a 0, ou seja, uma lista vazia
@crissilvaeng
crissilvaeng / Procfile
Created October 31, 2015 18:44
Deploy VRaptor Application in Heroku with Wildfly
web: target/wildfly-8.2.0.Final/bin/standalone.sh -Djboss.http.port=$PORT -b 0.0.0.0
@crissilvaeng
crissilvaeng / .tmux.conf
Last active August 17, 2016 05:29
Dev Utils
# remap prefix to Control + a
set -g prefix C-a
# bind 'C-a C-a' to type 'C-a'
bind C-a send-prefix
unbind C-b
type Party struct {
ID int `db:"id"`
Description string `db:"description"`
StartAt time.Time `db:"start_at"`
EndAt time.Time `db:"end_at"`
Dangerous bool `db:"dangerous"`
}