Skip to content

Instantly share code, notes, and snippets.

View leon-lourenco's full-sized avatar
🌊
Trying to find my way, every single day...

Leon Lourenço leon-lourenco

🌊
Trying to find my way, every single day...
View GitHub Profile
@leon-lourenco
leon-lourenco / YouTubeViewer.java
Created March 26, 2019 13:29
A embed YouTube video on a Swing application
public class YouTubeViewer {
public static void main(String[] args) {
NativeInterface.open();
SwingUtilities.invokeLater(new Runnable() {
public void run() {
JFrame frame = new JFrame("YouTube Viewer");
frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
frame.getContentPane().add(getBrowserPanel(), BorderLayout.CENTER);
frame.setSize(800, 600);
@leon-lourenco
leon-lourenco / ResponseEntityParser.java
Created July 26, 2019 14:50
Parser de JSON para response entitys em lista e em objeto
package me.fullcam.toolsapi.util;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import org.springframework.http.ResponseEntity;
import java.io.IOException;
import java.util.Arrays;
import java.util.List;
@leon-lourenco
leon-lourenco / BubbleSortExample.java
Created March 25, 2019 20:40
Bubble Sort Simple Example
public class BubbleSortExample {
public static void main(String[] args) {
int[] literallyAnything = {10, 2, 39, 666, 1823, 38853, 31, 2, 64, 231, 7};
int[] show = bubbleSort(literallyAnything);
for (int a = 0; a < show.length; a++) {
System.out.println(show[a]);
}
}
public static int[] bubbleSort(int v[]) {