Skip to content

Instantly share code, notes, and snippets.

View diogocapela's full-sized avatar

Diogo Capela diogocapela

View GitHub Profile
@diogocapela
diogocapela / $Dockerfiles.md
Last active December 12, 2017 14:04
Dockerfiles

Dockerfiles

@diogocapela
diogocapela / css_colors.js
Created December 16, 2017 14:26
All the 147 CSS colors in one JavaScript array.
let CSS_COLORS = ['aliceblue', 'antiquewhite', 'aqua', 'aquamarine', 'azure', 'beige', 'bisque', 'black', 'blanchedalmond', 'blue', 'blueviolet', 'brown', 'burlywood', 'cadetblue', 'chartreuse', 'chocolate', 'coral', 'cornflowerblue', 'cornsilk', 'crimson', 'cyan', 'darkblue', 'darkcyan', 'darkgoldenrod', 'darkgray', 'darkgrey', 'darkgreen', 'darkkhaki', 'darkmagenta', 'darkolivegreen', 'darkorange', 'darkorchid', 'darkred', 'darksalmon', 'darkseagreen', 'darkslateblue', 'darkslategray', 'darkslategrey', 'darkturquoise', 'darkviolet', 'deeppink', 'deepskyblue', 'dimgray', 'dimgrey', 'dodgerblue', 'firebrick', 'floralwhite', 'forestgreen', 'fuchsia', 'gainsboro', 'ghostwhite', 'gold', 'goldenrod', 'gray', 'grey', 'green', 'greenyellow', 'honeydew', 'hotpink', 'indianred', 'indigo', 'ivory', 'khaki', 'lavender', 'lavenderblush', 'lawngreen', 'lemonchiffon', 'lightblue', 'lightcoral', 'lightcyan', 'lightgoldenrodyellow', 'lightgray', 'lightgrey', 'lightgreen', 'lightpink', 'lightsalmon', 'lightseagreen', 'lights
/**
* Aplicar filtro da média a uma matriz.
*/
public int[][] filterMedia(int[][] matrix) {
int[][] novaMatrix = new int[matrix.length][matrix.length];
int[][] directions = new int[][] {
{-1, -1},
{-1, 0},
{-1, 1},
{ 0, -1},
@diogocapela
diogocapela / $Types of Array Sorting.md
Last active December 18, 2017 16:11
Types of Array Sorting

Types of Array Sorting

⁰¹²³⁴⁵⁶⁷⁸⁹₀₁₂₃₄₅₆₇₈₉
×
·
∈ ∉
@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()
));
}
@diogocapela
diogocapela / reset.css
Last active February 10, 2019 17:44
CSS Reset
::selection {
/* placeholder */
}
* {
box-sizing: border-box;
}
html {
/**
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 / 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
@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);