Skip to content

Instantly share code, notes, and snippets.

View ribasco's full-sized avatar
🎯

Rafael Ibasco ribasco

🎯
  • 19:54 (UTC +08:00)
View GitHub Profile
@ribasco
ribasco / create-mysql-connector.md
Last active July 21, 2023 04:37
How to install a mysql connector in Wildfly 10
  1. Download connector jar from mysql http://dev.mysql.com/downloads/connector/j/

  2. Unzip the downloaded file and copy the file mysql-connector-java-*-bin.jar to the new folder

WILDFLY_HOME/modules/system/layers/base/com/mysql/main

  1. create the file module.xml in the same folder with the following content:
@ribasco
ribasco / README.md
Created March 2, 2017 05:44
[DD-WRT] Count the Number of IP Connections from Command Line

wc -l < /proc/net/ip_conntrack

@ribasco
ribasco / rpmLargeFont.ino
Created September 13, 2017 05:07 — forked from ronivaldo/rpmLargeFont.ino
A set of custom made large numbers for a 16x2 LCD HD44780 Arduino Library
/*
A set of custom made large numbers for a 16x2 LCD using the
LiquidCrystal librabry. Works with displays compatible with the
Hitachi HD44780 driver.
The Cuicuit:
LCD RS pin to D12
LCD Enable pin to D11
LCD D4 pin to D5
LCD D5 pin to D4
@ribasco
ribasco / HowToChangeI2CSpeed.md
Last active December 4, 2022 07:45
How to change the I2C Frequency/Speed for Raspberry Pi 2/3

How to change the I2C Frequency/Speed for Raspberry Pi 2/3

Note: Steps 5-8 are only for verification purposes, you can skip them

  1. Open /boot/config.txt file

    sudo nano /boot/config.txt

@ribasco
ribasco / how-to-install-java-on-raspbian.md
Last active March 27, 2021 18:37
How to install the latest java version in Raspbian (Stretch)

Introduction

The default version of java provided in the latest raspbian images are outdated, so we are going to install from the ppa:webupd8team/java repository instead. Please note that add-apt-repository ppa:webupd8team/java will not work, so we will need to add the repository manually.

Installation

  1. Create the gpg key file and paste the following lines of text below
nano key.txt
@ribasco
ribasco / AES.c
Created November 21, 2018 02:15 — forked from bricef/AES.c
A simple example of using AES encryption in Java and C.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
/*
* MCrypt API available online:
* http://linux.die.net/man/3/mcrypt
*/
#include <mcrypt.h>
@ribasco
ribasco / idea.codestyle.json
Last active March 22, 2019 15:39
IDEA Code Style
{
"schemeName": "Project",
"version": "1.0",
"codeStyle": {
"all": {
"formatter_off_tag": "@formatter:off",
"formatter_on_tag": "@formatter:on",
"formatter_tags_accept_regexp": false,
"formatter_tags_enabled": false,
"max_line_length": 500,
@ribasco
ribasco / FloodFillSample.java
Last active January 5, 2020 12:00
[JavaFX] Flood Fill Algorithm (Recursive iteration approach)
public class DrawUtil {
private static class FillParams {
int x;
int y;
Color selectedColor;
private FillParams(int x, int y, Color selectedColor) {
this.x = x;
@ribasco
ribasco / JavaFX.xml
Last active December 16, 2020 05:36
Intellij IDE JavaFX Live Templates
<templateSet group="JavaFX">
<template name="fxlbool" value="private BooleanProperty $VARIABLE$;&#10;&#10;public boolean is$VARIABLE_UPPER$() {&#10; return $VARIABLE$Property().get();&#10;}&#10;&#10;public void set$VARIABLE_UPPER$(boolean value) {&#10; $VARIABLE$Property().set(value);&#10;}&#10;&#10;public BooleanProperty $VARIABLE$Property() {&#10; if (this.$VARIABLE$ == null) {&#10; this.$VARIABLE$ = new SimpleBooleanProperty(this, &quot;$VARIABLE$&quot;);&#10; }&#10; return this.$VARIABLE$;&#10;}" description="Boolean Property (Lazy)" toReformat="true" toShortenFQNames="true">
<variable name="VARIABLE" expression="camelCase(String)" defaultValue="" alwaysStopAt="true" />
<variable name="VARIABLE_UPPER" expression="capitalize(VARIABLE)" defaultValue="" alwaysStopAt="true" />
<context>
<option name="JAVA_CODE" value="true" />
</context>
</template>
<template name="fxlobj" value="private ObjectProperty&lt;$TYPE$&gt; $VARIABLE$;&#10;&#10;public $TYPE$ get$METHO
@ribasco
ribasco / SceneBuilderFix.md
Last active May 14, 2021 03:25
Make controlsfx work in SceneBuilder 16+ and JDK 9+

Make controlsfx/jfoenix controls work in SceneBuilder 16+ and JDK 9+

Need to add --add-opens and --add-exports directives to allow some controls to work in SceneBuilder (e.g. RangeSlider).

Simply edit the SceneBuilder.cfg file and update the the [JavaOptions] section.

From

[JavaOptions]