Skip to content

Instantly share code, notes, and snippets.

Keir Nellyer iKeirNez

Block or report user

Report or block iKeirNez

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View array_stack.h
#include "stack.h"
#include <vector>
class ArrayStack: public StackADT {
public:
ArrayStack(int size): stackSize(size), data(new int[stackSize]) {};
bool isEmpty() {
return top == 0;
}
@iKeirNez
iKeirNez / 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
#!/bin/bash
# usage: get_jdk.sh <jdk_version> <rpm|tar>
# jdk_version: default 8
# rpm
JDK_VERSION="8"
EXT="rpm"
if [ -n "$1" ]; then
View Lottery.cpp
#include <iostream>
#include <vector>
using namespace std;
#define NUMBER_AMOUNT 6
#define INPUT_LOWER_BOUND 1
#define INPUT_UPPER_BOUND 59
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
@Override
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()
.name(worldName.get())
.enabled(true)
View keybase.md

Keybase proof

I hereby claim:

  • I am iKeirNez on github.
  • I am keir_nellyer (https://keybase.io/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:

@iKeirNez
iKeirNez / Form1.vb
Created Sep 5, 2014
Fun in Computing
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)
View ReflectionHelper.java
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;
View BossBarManager.java
//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");
You can’t perform that action at this time.