Skip to content

Instantly share code, notes, and snippets.

@AnEmortalKid
AnEmortalKid / PropGrid.cs
Created June 11, 2023 19:19
Prop Palette
using System.Collections.Generic;
using System.Linq;
using DontDrown.Prop;
using FullscreenEditor;
using UnityEngine;
#if UNITY_EDITOR
namespace DontDrown.Editor.Props
{
using UnityEditor;
Call: Statement
Current character : 65 (65) at line 1 column 1
Possible string literal matches : { "ACTION", "ADD", "ADVANCE", "ALGORITHM",
"ALL", "ALTER", "AND", "ANY", "AS",
"ASC" }
Current character : 76 (76) at line 1 column 2
Possible string literal matches : { "ALGORITHM", "ALL", "ALTER" }
Current character : 84 (84) at line 1 column 3
Possible string literal matches : { "ALTER" }
Current character : 69 (69) at line 1 column 4
JMonterrubio@RaccoonGames MINGW64 /j/Workspaces/sling
$ java -jar org.apache.sling.starter-10.jar
11.03.2018 19:37:29.484 *INFO * [main] Setting sling.home=sling (default)
11.03.2018 19:37:29.485 *INFO * [main] Starting Apache Sling in J:\Workspaces\sling\sling
11.03.2018 19:37:29.487 *INFO * [main] Sling Extension Lib Home : J:\Workspaces\sling\sling\ext
11.03.2018 19:37:29.491 *INFO * [main] Checking launcher JAR in folder J:\Workspaces\sling\sling
11.03.2018 19:37:29.500 *INFO * [main] Existing launcher is up to date, using it: 5.6.10.2_6_26 (org.apache.sling.launchpad.base.jar)
11.03.2018 19:37:29.501 *INFO * [main] Loading launcher class org.apache.sling.launchpad.base.app.MainDelegate from org.apache.sling.launchpad.base.jar
11.03.2018 19:37:29.502 *INFO * [main] External Libs Home (ext) is null or does not exists.
11.03.2018 19:37:29.524 *INFO * [main] Setting sling.launchpad=J:\Workspaces\sling\sling
@AnEmortalKid
AnEmortalKid / JanTrie.scala
Created July 10, 2017 23:10
implementation of a Trie, Trie is already a thing so thus it is JanTrie plz dont cry
import scala.collection.mutable.ListBuffer
/**
* Created by JMonterrubio on 7/8/2017.
*/
class JanTrie(value: Option[Char], parent: JanTrie) {
val children: collection.mutable.Map[Char, JanTrie] = collection.mutable.Map();
var isWord = false;
@AnEmortalKid
AnEmortalKid / BuilderGeneratorPrinter
Created May 18, 2017 14:35
prints some builder code into the console
import java.lang.reflect.Field;
import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;
import java.text.MessageFormat;
import java.util.Collection;
public class BuilderGeneratorPrinter
{
public static void printBuilderForClass (final String internalObjectName, final Class<?> classToCreateBuilderFor)
{
@AnEmortalKid
AnEmortalKid / gist:248f7226a7b34dd506802b813aadde9b
Created April 2, 2016 03:16
JQuery to post to robin reddit messages
$.ajax({
url: 'https://www.reddit.com/api/robin/2e53fb96-f87f-11e5-be28-0e31fc1b0d95/message',
type: 'post',
data: {
room_id:'2e53fb96-f87f-11e5-be28-0e31fc1b0d95',
room_name:'DeKIOaoerdtsleHIpoorozisesnkrdisramitFer71inicok',
winning_vote:'NOVOTE',
api_type:'json',
message:'fuck the police lol',
author:'',
Ok, so it seems that you have a set of Questions and you have to display all of them. Here's the steps we'll take:
1. We are going to create a Question object, which will hold all the data of our questions. It will hold the question, the correct answer, and the options you want to give people.
2. Then we are going to create a method that can take this question, and display it. Alright, so let's start.
Our Question object is going to hold three fields:
1. A String question, which is the text of the question.
2. A String correctAnswer, which is the text of the correct answer
@AnEmortalKid
AnEmortalKid / QuizDisplayer.java
Created March 20, 2016 21:11
The final sample of the Quiz displayer
public class QuizDisplayer {
private static boolean displayQuestion(Question question) {
int optionChosen = JOptionPane.showOptionDialog(null, question.getQuestion(), "Please Select",
JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE, null, question.getAnswerOptions(),
question.getAnswerOptions()[0]);
String answer = question.getAnswerOptions()[optionChosen];
boolean correct = answer.equals(question.getCorrectAnswer());
@AnEmortalKid
AnEmortalKid / QuizDisplayer.java
Created March 20, 2016 21:05
modified with two questions and displaying correct or not
public class QuizDisplayer {
private static boolean displayQuestion(Question question) {
int optionChosen = JOptionPane.showOptionDialog(null, question.getQuestion(), "Please Select",
JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE, null, question.getAnswerOptions(),
question.getAnswerOptions()[0]);
String answer = question.getAnswerOptions()[optionChosen];
boolean correct = answer.equals(question.getCorrectAnswer());
private static boolean displayQuestion(Question question) {
int optionChosen = JOptionPane.showOptionDialog(null, question.getQuestion(), "Please Select",
JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE, null, question.getAnswerOptions(),
question.getAnswerOptions()[0]);
String answer = question.getAnswerOptions()[optionChosen];
boolean correct = answer.equals(question.getCorrectAnswer());
return correct;
}