Skip to content

Instantly share code, notes, and snippets.

View jsfan3's full-sized avatar
💡
I make mobile apps using Codename One + Spring Boot

Francesco Galgani jsfan3

💡
I make mobile apps using Codename One + Spring Boot
View GitHub Profile
@jsfan3
jsfan3 / MyApplication.java
Created February 15, 2020 13:07
SpanMultiButton test case
Form hi = new Form("Test SpanMultiButton", BoxLayout.y());
Image icon = FontImage.createMaterial(FontImage.MATERIAL_WARNING, "Button", 3.0f);
Image emblem = FontImage.createMaterial(FontImage.MATERIAL_ARROW_FORWARD, "Button", 3.0f);
SpanMultiButton twoLinesNoIcon = new SpanMultiButton("SpanMultiButton");
twoLinesNoIcon.setTextLine2("Line 2 long - Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.");
SpanMultiButton oneLineIconEmblem = new SpanMultiButton("Icon + Emblem");
oneLineIconEmblem.setIcon(icon);
oneLineIconEmblem.setEmblem(emblem);
@jsfan3
jsfan3 / mybackup.sh
Created January 25, 2020 13:29
Script di backup per GNU/Linux, basato su Bash e Rsync. Maggiori informazioni: https://www.informatica-libera.net/content/mybackup-gnulinux-backup-utility-based-rsync-francesco-galgani
#!/bin/bash
#################################################################################
################### MyBACKUP SCRIPT ####################
#################################################################################
# License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
# This is free software: you are free to change and redistribute it.
# There is NO WARRANTY, to the extent permitted by law.
# Autori: Francesco Galgani
@jsfan3
jsfan3 / AppApplication.java
Created June 3, 2019 06:58
Cloudinary in Spring Boot - Three files: the main AppApplication, the Controller and the Service, by Francesco Galgani, www.informatica-libera.net
package yourpackage.app;
import com.cloudinary.Cloudinary;
import com.cloudinary.SingletonManager;
import com.cloudinary.utils.ObjectUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.scheduling.annotation.EnableScheduling;
@jsfan3
jsfan3 / RunnableWithArg.java
Created May 8, 2019 12:59
Java Runnable With Arg
public interface RunnableWithArg<T> {
/**
* Similar to the runnable interface but it accepts an argument
*
* @param arg any type of argument
*/
public void run(T arg);
}
@jsfan3
jsfan3 / AppSettingsUtilitiesImpl.java
Created January 2, 2019 23:47
Codename One Android Native Interface to access the app settings
package net.informaticalibera.cn1.simpleapi;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.provider.Settings;
public class AppSettingsUtilitiesImpl {
private static Context context() {
Android and iOS videos
spring.datasource.url=jdbc:mysql://localhost/nomeDB
spring.datasource.username=root
spring.datasource.password=miaPassword
spring.datasource.driver-class-name=org.mariadb.jdbc.Driver
spring.jpa.hibernate.ddl-auto=update
spring.jpa.generate-ddl=true
spring.datasource.tomcat.connection-properties=useUnicode=true
server.port=8080