Skip to content

Instantly share code, notes, and snippets.

View jdesive's full-sized avatar

Jack DeSive jdesive

  • Quest Analytics
  • Kansas
View GitHub Profile
@jdesive
jdesive / SCP.md
Created March 28, 2019 19:00
SCP Cheatsheet

Different Port

scp -P 2264 yourfile.txt your_username@remote.host.com:/some/remote/directory

Files

From Remote to Local

scp your_username@remote.host.com:yourfile.txt /some/local/directory

From Local to Remote

@jdesive
jdesive / setup.md
Created January 28, 2018 00:00
Mount NFS share from synology NAS to Ubuntu

Mount Synology NFS share to Ubuntu 16.04

I have all hardware virtualized in ESXi 6.5...
Synology DSM 5.2-5644
Ubuntu 16.04

Start

On your fresh install on Ubuntu 16.04:

  1. Click the Connections icon on the top bar
  2. Goto Edit Connections
@jdesive
jdesive / FolderSelector.java
Created January 1, 2018 02:40
Example of a JavaFX DirectoryChooser widget that can resize to fit the screen.
package com.desive.stages.components;
import com.desive.utilities.StageDictionary;
import javafx.geometry.Insets;
import javafx.scene.Group;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
import javafx.scene.control.TextField;
import javafx.scene.layout.ColumnConstraints;
import javafx.scene.layout.GridPane;
@jdesive
jdesive / jpa-hibernate.md
Last active October 8, 2017 00:55
Help with Spring Boot JPA/Hibernate Entity mappings

Help with JPA/Hibernate in Spring Boot

Note: Using a Set<?> is the proper way of creating a list of objects. Using a List<?> and adding an item to the List, the entire List will be removed and recreated.

Creating an entity

@Entity
@Table(name = "foos")
@ToString // Lombok
public class Foo {
@jdesive
jdesive / Request.java
Last active October 4, 2017 20:00
A Request class for java to make Http calls
import java.io.BufferedReader;
import java.io.DataOutputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
import java.util.Map;
public class Request {
@jdesive
jdesive / toString-8.java
Last active October 3, 2017 06:35
Dynamic toString method that excludes null values
@Override
public String toString(){
StringBuilder stringBuilder = new StringBuilder(this.getClass().getSimpleName()).append("[ ");
Arrays.stream(getClass().getDeclaredFields()).filter(field -> {
field.setAccessible(true);
try {
Object value = field.get(this);
if(value != null)
return true;
} catch (IllegalAccessException e) {}
@jdesive
jdesive / table.md
Created September 10, 2017 08:21
Github Commit Emojis

A table to show how to properly use emojis in github commits

Commit type Emoji
Initial commit 🎉 :tada:
Version tag 🔖 :bookmark:
New feature :sparkles:
Bugfix 🐛 :bug:
Metadata 📇 :card_index:
Documentation 📚 :books: