Skip to content

Instantly share code, notes, and snippets.


Keir Nellyer keir-nellyer

View GitHub Profile
View array_stack.h
#include "stack.h"
#include <vector>
class ArrayStack: public StackADT {
ArrayStack(int size): stackSize(size), data(new int[stackSize]) {};
bool isEmpty() {
return top == 0;
keir-nellyer / split.cpp
Last active Feb 18, 2016
C++ Split Function
View split.cpp
* This method takes a string input and splits it at every instance of the defined deliminator
* None of the results will include the deliminator, here are some example inputs and their corresponding output
* Assume deliminator is ", " every time
* hey, this is a message, :) ["hey", "this is a message", ":)"]
* , hello! ["hello"]
* how, are you?, ["how", "are you?"]
vector<string> split(string input, string deliminator) {
View gist:7ff0c44fd2eecc4c2cf3
# usage: <jdk_version> <rpm|tar>
# jdk_version: default 8
# rpm
if [ -n "$1" ]; then
View Lottery.cpp
#include <iostream>
#include <vector>
using namespace std;
string* rewards = new string[NUMBER_AMOUNT + 1] { "Nothing.", "One Free Lucky Dip", "£25", "~£100", "~£1,000", "~£50,000", "Jackpot" };
View Sponge async world generating attempt
public CommandResult execute(CommandSource src, CommandContext args) throws CommandException {
Optional<String> worldName = args.getOne("world-name");
src.sendMessage(Texts.of("Starting world build..."));
if (worldName.isPresent()) {
Optional<World> worldOptional = game.getRegistry().createWorldBuilder()

Keybase proof

I hereby claim:

  • I am iKeirNez on github.
  • I am keir_nellyer ( on keybase.
  • I have a public key whose fingerprint is 46E7 5387 6273 99AE 3734 099F 279B 64A7 971B 4FF4

To claim this, I am signing this object:

View Form1.vb
Dim random As Random = New Random
Private Sub PictureBox1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PictureBox1.Click
Dim amount As Integer = InputBox("How many times?")
Dim index As Integer = 0
Do While index < amount
Dim systemSound As Media.SystemSound
Dim i As Integer = random.Next(0, 5)
package com.iKeirNez.CastleDefence.slave.utilities;
import org.bukkit.Bukkit;
import org.bukkit.entity.Entity;
import org.bukkit.entity.Player;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
//Accessing packets
private Object getMobPacket(){
Location loc = entity.getLocation().subtract(0, 5, 0);
Class<?> mob_class = ReflectionHelper.getNMSClass("PacketPlayOutSpawnEntityLiving");
Object mobPacket = null;
try {
mobPacket = mob_class.newInstance();
Field a = ReflectionHelper.getField(mob_class, "a");