Skip to content

Instantly share code, notes, and snippets.

View justisr's full-sized avatar
💭
Processing

Justis R justisr

💭
Processing
  • BuiltByBit
  • United States
View GitHub Profile
@justisr
justisr / build.js
Last active November 24, 2023 21:16
import { readdir, rm, mkdir, rename } from 'node:fs/promises';
import { join, resolve } from 'path';
const start = performance.now();
const srcDir = join('src', 'main', 'resources', '_static');
const targetDir = join('target', 'classes', '_static');
async function fileHash(file) {
const md5Hasher = new Bun.CryptoHasher('md5');
return md5Hasher.update(await file.text()).digest('hex').substring(0, 16);
var Pa=Object.create;var{defineProperty:ra,getPrototypeOf:Oa,getOwnPropertyNames:Ca}=Object;var Ka=Object.prototype.hasOwnProperty;var Ma=(a,i,n)=>{n=a!=null?Pa(Oa(a)):{};const o=i||!a||!a.__esModule?ra(n,"default",{value:a,enumerable:!0}):n;for(let e of Ca(a))if(!Ka.call(o,e))ra(o,e,{get:()=>a[e],enumerable:!0});return o};var O=(a,i)=>()=>(i||a((i={exports:{}}).exports,i),i.exports);var sa=O((qa,ga)=>{var ta;ta={passwords:"123456,password,12345678,qwerty,123456789,12345,1234,111111,1234567,dragon,123123,baseball,abc123,football,monkey,letmein,shadow,master,696969,mustang,666666,qwertyuiop,123321,1234567890,pussy,superman,654321,1qaz2wsx,7777777,fuckyou,qazwsx,jordan,123qwe,000000,killer,trustno1,hunter,harley,zxcvbnm,asdfgh,buster,batman,soccer,tigger,charlie,sunshine,iloveyou,fuckme,ranger,hockey,computer,starwars,asshole,pepper,klaster,112233,zxcvbn,freedom,princess,maggie,pass,ginger,11111111,131313,fuck,love,cheese,159753,summer,chelsea,dallas,biteme,matrix,yankees,6969,corvette,austin,access,thunder,mer
@justisr
justisr / Eclipse.md
Last active August 2, 2023 19:07 — forked from danthe1st/Eclipse.md
Why I personally prefer Eclipse over IntelliJ

Why I personally prefer Eclipse over IntelliJ

Introduction/Disclaimers

I do not claim any IDE being better than another. These are just reasons I personally like developing in Eclipse more than I like developing in IntelliJ.

I have used both Eclipse and IntelliJ for quite some time and I cannot deny that both are excellent IDEs. While Eclipse is better for me, this might not be the case for you. This is my subjective opinion and this gist is intended to explain some reasons so I don't have to repeat myself all the time.

As I am (mainly) a Java developer, this applies to Java development specifically but some points may not be specific to Java.

What is compared?

IntelliJ comes in two editions: Community Edition (free) and Ultimate Edition (paid). When comparing Eclipse and IntelliJ, this is (in my experience) often ignored. Some functionality is possible in Eclipse (especially using Eclipse IDE for Enterprise Java Developers which is Free and Open Source as well) which is available in IntelliJ

@justisr
justisr / gist:72423b92e1880c8f0a1cbdfcaa75da1d
Created August 13, 2021 00:46 — forked from dsci/gist:1347672
Delete commits from repository.
# First, check out the commit you wish to go back to (get sha-1 from git log)
git reset --hard 9d3c3a0caa7f7b35ef15adb96fc80fcbb59ac72a
# Then do a forced update.
git push origin +9d3c3a0caa7f7b35ef15adb96fc80fcbb59ac72a^:develop
# Push specific commit
git push origin 9d3c3a0caa7f7b35ef15adb96fc80fcbb59ac72a:develop -f
package com.gmail.justisroot.broker;
import java.math.BigDecimal;
import java.util.UUID;
import org.spongepowered.api.item.inventory.Inventory;
import org.spongepowered.api.item.inventory.ItemStack;
public interface Broker {
final class AccessorTest {
@Test // SUCCESS
@DisplayName("Verify MethodHandles.Lookup constructor")
void lookupConstructorAvailabilityTest() {
Assertions.assertDoesNotThrow(() -> Accessor.newLookupConstructor());
}
@Test // SUCCESS
@DisplayName("Verify available matching instance method is called")
@justisr
justisr / AESystem.java
Last active December 21, 2018 17:20
Managing a large project’s systems, and ensuring their enable/disable ordering can be tiresome. Automate the process.
package com.gmail.justisroot.autoecon;
import java.util.ArrayList;
import java.util.List;
import com.gmail.justisroot.autoecon.command.SoftCommand;
import com.gmail.justisroot.autoecon.data.EventProvider;
import com.gmail.justisroot.autoecon.data.FilePool;
import com.gmail.justisroot.autoecon.data.ScheduledSave;
import com.gmail.justisroot.autoecon.data.file.UserData;
@justisr
justisr / hmff.sublime-syntax
Created September 20, 2018 00:22
Sublime text syntax file for HMFF
%YAML 1.2
---
name: HMFF
file_extensions: [hmff]
scope: source.c
contexts:
main:
- match: "^\\s*?(#).*"
scope: comment.line
@justisr
justisr / Minifier.java
Last active January 25, 2020 17:43
Strip comments and minify your JSON strings with O(n) performance
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
public final class Minifier {
@justisr
justisr / Unit.java
Created September 7, 2018 18:53
BigDecimal wrapper which prioritizes the re-use of existing instances and removes trailing zeros.
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.concurrent.ConcurrentMap;
import com.google.common.collect.MapMaker;
public class Unit {
private static ConcurrentMap<String, Unit> POOL = new MapMaker().weakValues().concurrencyLevel(1).initialCapacity(666).makeMap();