Skip to content

Instantly share code, notes, and snippets.

View diogocapela's full-sized avatar

Diogo Capela diogocapela

View GitHub Profile
@diogocapela
diogocapela / random.c
Created April 17, 2019 15:36
Get Random Number in C
int getRandomIntBetween(int min, int max) {
srand(time(NULL) * getpid() << 16);
int randomNumber = (rand() % max) + min;
return randomNumber;
}
@diogocapela
diogocapela / Makefile
Created April 1, 2019 11:20
Exercício Moodle Aula LPROG
# Makefile for using flex with bison
#
# The executable receives the name of the current folder
# Do not use spaces in the name of the folder
#
# The .lex and .y files used are the first ones found by ls
#
# If there is a .txt file, it will be used as the input of the executable
#
# This Makefile works on Linux and on OSX
@diogocapela
diogocapela / Makefile
Created March 29, 2019 19:58
Makefile LPROG
# Makefile de exemplo de uso do flex
#
# O programa fica com o nome da pasta onde estamos
# Não usar espaços no nome!
#
# O ficheiro flex usado é o primeiro encontrado pelo ls
#
# Se existir um ficheiro .txt este será usado como standard input
# ao correr o programa
#
@diogocapela
diogocapela / Makefile
Created March 28, 2019 21:59
Makefile de LPROG (Genérico para macOS e Windows)
# Makefile for using flex with bison
#
# The executable receives the name of the current folder
# Do not use spaces in the name of the folder
#
# The .lex and .y files used are the first ones found by ls
#
# If there is a .txt file, it will be used as the input of the executable
#
# This Makefile works on Linux and on OSX
@diogocapela
diogocapela / easing.css
Created January 3, 2019 01:14 — forked from adamwathan/easing.css
Easing CSS variables
:root {
--ease-in-quad: cubic-bezier(.55, .085, .68, .53);
--ease-in-cubic: cubic-bezier(.550, .055, .675, .19);
--ease-in-quart: cubic-bezier(.895, .03, .685, .22);
--ease-in-quint: cubic-bezier(.755, .05, .855, .06);
--ease-in-expo: cubic-bezier(.95, .05, .795, .035);
--ease-in-circ: cubic-bezier(.6, .04, .98, .335);
--ease-out-quad: cubic-bezier(.25, .46, .45, .94);
--ease-out-cubic: cubic-bezier(.215, .61, .355, 1);
@diogocapela
diogocapela / moment-js-timezones.txt
Created September 7, 2018 00:10
List of All Moment.js Timezones
Africa/Abidjan
Africa/Accra
Africa/Addis_Ababa
Africa/Algiers
Africa/Asmara
Africa/Asmera
Africa/Bamako
Africa/Bangui
Africa/Banjul
Africa/Bissau
import java.util.ArrayList;
import java.util.List;
public class Escrutinio {
// variaveis de insância
private List<Candidato> candidatos;
private int numEleitores;
private int numVot;
private int data;
@diogocapela
diogocapela / reset.css
Last active February 10, 2019 17:44
CSS Reset
::selection {
/* placeholder */
}
* {
box-sizing: border-box;
}
html {
/**
@diogocapela
diogocapela / example.java
Created May 31, 2018 23:31
JavaFX UI methods example
// Updating a JavaFX table when UI loads example
private void updateView() {
col1.setCellValueFactory(new PropertyValueFactory<>("id"));
col2.setCellValueFactory(new PropertyValueFactory<>("username"));
col3.setCellValueFactory(new PropertyValueFactory<>("email"));
col4.setCellValueFactory(new PropertyValueFactory<>("password"));
table.setItems(FXCollections.observableArrayList(
system.getUserRegistry()
));
}
⁰¹²³⁴⁵⁶⁷⁸⁹₀₁₂₃₄₅₆₇₈₉
×
·
∈ ∉