Skip to content

Instantly share code, notes, and snippets.

View keir-nellyer's full-sized avatar

Keir Nellyer keir-nellyer

View GitHub Profile
#include "stack.h"
#include <vector>
class ArrayStack: public StackADT {
public:
ArrayStack(int size): stackSize(size), data(new int[stackSize]) {};
bool isEmpty() {
return top == 0;
}
@keir-nellyer
keir-nellyer / split.cpp
Last active February 18, 2016 11:22
C++ Split Function
/**
* 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) {
@keir-nellyer
keir-nellyer / gist:7ff0c44fd2eecc4c2cf3
Created January 29, 2016 01:05 — forked from n0ts/get_oracle_jdk_x64.sh
get_jdk_linux_x64.sh
#!/bin/bash
# usage: get_jdk.sh <jdk_version> <rpm|tar>
# jdk_version: default 8
# rpm
JDK_VERSION="8"
EXT="rpm"
if [ -n "$1" ]; then
#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" };
@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)

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:

@keir-nellyer
keir-nellyer / Form1.vb
Created September 5, 2014 17:30
Fun in Computing
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");