Skip to content

Instantly share code, notes, and snippets.

View Maslor's full-sized avatar

Gabriel Freire Maslor

View GitHub Profile
@jsyeo
jsyeo / Main.java
Created September 3, 2015 00:57
Reflection
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
public class Reflection {
public static void vulnerableMethod() {
}
public void reflectVulnerableMethod() throws ClassNotFoundException, NoSuchMethodException, SecurityException,
@Maslor
Maslor / findUser.java
Last active August 29, 2015 14:25
Getting a subclass element from the abstract superclass type list
private List<Manager> _managers = new ArrayList<Manager>();
private List<Employee> _employees = new ArrayList<Employee>();
private List<User> _usrs = new ArrayList<User>();
public User findUser(String userID){
refreshUserList(); //updates _usrs so it has all the current users
Iterator<User> i;
User u = null; //abstract class User
i = this._usrs.iterator();
@uphy
uphy / ExpandableListView.java
Last active June 2, 2023 20:54
JavaFX Expandable ListView
/**
* Copyright (C) 2015 uphy.jp
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@KingC100
KingC100 / gist:8040948
Last active March 26, 2021 09:41
JavaFX  background-color
public class FXErycton extends Application {
@Override
public void start(Stage stage) throws Exception {
Parent root = FXMLLoader.load(getClass().getResource("FXErycton.fxml"));
root.setStyle("-fx-background-color: #F0591E;");
Scene scene = new Scene(root);
stage.setTitle("FXErcycton v1.0.0");
@jlengstorf
jlengstorf / gist:2760279
Created May 21, 2012 02:09
#1 Code example from "JSON: What It Is, How It Works, & How to Use It"
var jason = {
"age" : "24",
"hometown" : "Missoula, MT",
"gender" : "male"
};