Skip to content

Instantly share code, notes, and snippets.

View ducc's full-sized avatar

Joe Burnard ducc

  • UK
View GitHub Profile
package de.zh32.slp;
import com.google.gson.Gson;
import java.io.ByteArrayOutputStream;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
@ducc
ducc / SimpleScoreboard.java
Last active August 29, 2015 14:25 — forked from mkotb/SimpleScoreboard.java
Non-flickering scoreboard implementation; create scoreboards with ease.
import com.google.common.base.Preconditions;
import com.google.common.base.Splitter;
import com.google.common.collect.Lists;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.OfflinePlayer;
import org.bukkit.entity.Player;
import org.bukkit.scoreboard.*;
import java.util.*;
@ducc
ducc / Windows10-Setup.ps1
Last active August 29, 2015 14:26 — forked from NickCraver/Windows10-Setup.ps1
(In Progress) PowerShell Script I use to customize my machines in the same way for privacy, search, UI, etc.
##################
# Privacy Settings
##################
# Privacy: Let apps use my advertising ID: Disable
Set-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\AdvertisingInfo -Name Enabled -Type DWord -Value 0
# To Restore:
#Set-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\AdvertisingInfo -Name Enabled -Type DWord -Value 1
# Privacy: SmartScreen Filter for Store Apps: Disable
Set-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\AppHost -Name EnableWebContentEvaluation -Type DWord -Value 0

I spent a while writing this out, so please give it a read and try this out. You'll thank me soon!

Explenations

Why shouldn't you be using static?

Static is not evil, however you are using it wrong. This is known as 'static abuse'. http://stackoverflow.com/questions/1766715/when-not-to-use-the-static-keyword-in-java http://stackoverflow.com/questions/7026507/why-are-static-variables-considered-evil

I would highly advise checking out the first 20 or so of the new boston's java tutorials. Some may disagree, however I believe that they are very helpful

@ducc
ducc / Bot prefixes.md
Last active December 13, 2015 22:17
A collection of prefixes that each bot uses for commands.

Bot prefixes:

  • spongybot: #
  • wee.bot: `
  • beta_bot: !
  • guster.conch: -
  • chester.bot.v2: $
  • infodousbot: ~
  • ptp.bot: .
  • pangeabot: @
  • phobiaknown: %
public abstract class CommandExecutor {
private final String command, permission; // you can group variables of the same type together like this
private final boolean console, player;
private final int length;
/*
Instantiating the variables inside of the constructor instead of using a setter. If you do not want all of these
to be set (e.g. if some are optional) you can have multiple constructors.
*/
@ducc
ducc / CommandBus.java
Last active March 5, 2016 20:11
Consumer based command system
import java.util.*;
import java.util.concurrent.locks.ReadWriteLock;
import java.util.concurrent.locks.ReentrantReadWriteLock;
import java.util.function.Consumer;
public class CommandBus {
private final Map<String, List<Consumer<String[]>>> handlers = new HashMap<>();
private final ReadWriteLock lock = new ReentrantReadWriteLock();
package main
import (
"reflect"
)
type MyEnum struct {
SOME_VALUE string
SOME_OTHER_THING string
}
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<!-- this section is details about your project -->
<groupId>me.monitor</groupId>
<artifactId>monitoringbotv04</artifactId>
<version>1.0</version> <!-- this is the version of your project, can be set to anything -->

Keybase proof

I hereby claim:

  • I am sponges on github.
  • I am sponges (https://keybase.io/sponges) on keybase.
  • I have a public key whose fingerprint is 61CA 9260 0F91 EA95 A4B4 DA4E BBD7 7FAD ABE2 B9EA

To claim this, I am signing this object: