Skip to content

Instantly share code, notes, and snippets.

View emorgado's full-sized avatar

Emerson Jose Morgado Brito emorgado

View GitHub Profile
@emorgado
emorgado / 0_reuse_code.js
Created July 30, 2014 13:16
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@emorgado
emorgado / ProcessamentoController.java
Created April 6, 2015 13:35
ProcessamentoController.java
clItemBetonadaSobrepeso.setCellFactory(new Callback<TableColumn<ItemBetonada, Boolean>, TableCell<ItemBetonada, Boolean>>() {
public TableCell<ItemBetonada, Boolean> call(TableColumn<ItemBetonada, Boolean> param) {
return new TableCell<ItemBetonada, Boolean>() {
Label label;
{
label = new Label("");
label.getStyleClass().add("mixcontroller-icon");
setGraphic(label);
}
@emorgado
emorgado / invertColor.js
Created September 19, 2017 17:05
How to invert color using javascript, just to remember
// https://stackoverflow.com/questions/35969656/how-can-i-generate-the-opposite-color-according-to-current-color
function invertColor(hex, bw) {
if (hex.indexOf('#') === 0) {
hex = hex.slice(1);
}
// convert 3-digit hex to 6-digits.
if (hex.length === 3) {
hex = hex[0] + hex[0] + hex[1] + hex[1] + hex[2] + hex[2];
}
if (hex.length !== 6) {
@emorgado
emorgado / _widget.gsp
Created September 19, 2017 18:45
Grails fieldsPlugin override select with inLIst constraint
<%--
<pre>
controllerName: ${controllerName}
actionName: ${actionName}
themeName: ${themeName}
superClass: ${superclass}
propertyName: ${propertyName}
propertyType: ${propertyType}
propertySuperclass: ${propertySuperclass}
associationType: ${associationType}
@emorgado
emorgado / my.cnf
Created July 14, 2024 17:45 — forked from fevangelou/my.cnf
Optimized my.cnf configuration for MySQL/MariaDB (on Ubuntu, CentOS, Almalinux etc. servers)
# === Optimized my.cnf configuration for MySQL/MariaDB (on Ubuntu, CentOS, Almalinux etc. servers) ===
#
# by Fotis Evangelou, developer of Engintron (engintron.com)
#
# ~ Updated December 2021 ~
#
#
# The settings provided below are a starting point for a 8-16 GB RAM server with 4-8 CPU cores.
# If you have different resources available you should adjust accordingly to save CPU, RAM & disk I/O usage.
#