Skip to content

Instantly share code, notes, and snippets.

View julianjupiter's full-sized avatar

Julian Jupiter julianjupiter

View GitHub Profile
@julianjupiter
julianjupiter / ComboBoxTest.java
Created January 28, 2018 13:35
Example of JavaFX ComboBox
import java.util.ArrayList;
import java.util.List;
import javafx.application.Application;
import javafx.scene.Group;
import javafx.scene.Scene;
import javafx.scene.control.ComboBox;
import javafx.stage.Stage;
public class ComboBoxTest extends Application {
@julianjupiter
julianjupiter / hide-and-show.html
Created February 6, 2018 05:25
Mouseover and Mouseout in jQuery
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>toggle demo</title>
<style>
#p {
display: none;
}
@julianjupiter
julianjupiter / contact.php
Last active February 14, 2018 14:30
Example of PHP RESTful Web Service
<?php
header("Access-Control-Allow-Origin: *");
$id = isset($_GET['id']) ? $_GET['id'] : NULL;
if ($id != NULL)
{
$contact = findById($id);
if ($contact != NULL)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<link rel="stylesheet" href="node_modules/bootstrap/dist/css/bootstrap.min.css">
<style>
@julianjupiter
julianjupiter / FullName.java
Last active June 1, 2018 16:29
Enter name and display its different format and other information.
import javax.swing.JOptionPane;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
/**
* Assumption:
* Name should be two or three strings, e.g. Juan Cruz, Juan Dela Cruz.
*/
public class FullName {
@julianjupiter
julianjupiter / JavaFXWebView.java
Created June 1, 2018 12:31
Basic example of JavaFX WebView
package io.github.julianjupiter.jblog;
import javafx.application.Application;
import javafx.scene.Group;
import javafx.scene.Scene;
import javafx.scene.layout.VBox;
import javafx.scene.web.WebEngine;
import javafx.scene.web.WebView;
import javafx.stage.Stage;
@julianjupiter
julianjupiter / index.php
Last active June 4, 2018 16:20
Simple Routing in PHP
<?php
$contextPath = '/pepcon';
$url = isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : $contextPath;
$requestMethod = isset($_SERVER['REQUEST_METHOD']) ? $_SERVER['REQUEST_METHOD'] : 'GET';
$urlSegments = explode('/', rtrim($url));
echo 'URL: ' . $url . '<br>';
echo 'HTTP Method: ' . $requestMethod . '<br>';
echo '<pre>';
public class ArrayOfIntegerReverse {
public static void main(String[] args) {
int[] intArr = new int[] {1, 2, 3, 4, 5};
int[] newIntArr = reverse(intArr);
for (int i = 0; i < intArr.length; i++) {
System.out.print(intArr[i] + " ");
}

Keybase proof

I hereby claim:

  • I am julianjupiter on github.
  • I am julianjupiter (https://keybase.io/julianjupiter) on keybase.
  • I have a public key ASCIp9p6pg3WD9MbsneyH8jLS6SXlAIr3V_XzCklwUH8Vwo

To claim this, I am signing this object:

@julianjupiter
julianjupiter / java-functional-interface.md
Last active October 5, 2018 10:39
Functional Interface in Java

Functional Interface in Java

Example:

@FunctionalInterface
public interface Handler {
  void hello();
}

To use: