Skip to content

Instantly share code, notes, and snippets.

View ribasco's full-sized avatar
💀

Rafael Ibasco ribasco

💀
View GitHub Profile
@ribasco
ribasco / index.html
Created September 26, 2022 15:15
Matt Cowley - Console Site
<body id="particles-js">
<style id="cmd-css">
</style>
<div class='console'>
<div class='console-inner'>
<div id="outputs">
</div>
<div class='console-prompt-box'>
<span class='console-label'>User ></span><input type="text" class='console-input' placeholder="Type command...">
</div>
@ribasco
ribasco / clinterp.md
Last active August 22, 2022 02:12
About cl_interp
@ribasco
ribasco / SourceInfoQuery.java
Last active September 30, 2021 10:24
Source Info Query in Java (New Update)
import java.io.IOException;
import java.io.PrintStream;
import java.net.InetSocketAddress;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.nio.channels.DatagramChannel;
import java.nio.charset.StandardCharsets;
class SourceInfoQuery {
@ribasco
ribasco / fixperms.sh
Last active September 28, 2021 07:48
Simple bash script to fix the SSH Permissions of a user (in case you encounter Bad Ownership errors)
#!/bin/bash
set -e
if [[ $UID != 0 ]]; then
echo "Please run this script with sudo"
exit 1
fi
HOME_USER=$1
@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]
@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 / 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 / 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 / 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 / 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