Skip to content

Instantly share code, notes, and snippets.

View sam-irl's full-sized avatar
5 assignments overdue

sam-irl

5 assignments overdue
  • Norman, OK
View GitHub Profile
@sam-irl
sam-irl / Enchantments.java
Last active July 18, 2017 21:00
List of enchantments and their options for names
// I know this is pretty self explanatory, but these are the enchantment options
// The names grouped together (ie not seperated by `enchant = Enchantment.NAME`) refer to the same enchantment
// The vanilla (default) name is in each cluster, usually near the end
// If somehow you are still confused open an issue at https://github.com/sam-irl/Enchanted
// Code snippet taken from switch() block in Overenchant.java#onCommand() (line 38 as of 3b1c83a)
case "arrowdamage":
case "power":
enchant = Enchantment.ARROW_DAMAGE;
case "arrowfire":
case "firearrow":
@sam-irl
sam-irl / snakecoin-server-full-code.py
Last active July 24, 2017 15:06 — forked from aunyks/snakecoin-server-full-code.py
The code in this gist isn't as succinct as I'd like it to be. Please bare with me and ask plenty of questions that you may have about it.
from flask import Flask
from flask import request
import json
import requests
import hashlib as hasher
import datetime as date
node = Flask(__name__)
# Define what a Snakecoin block is
class Block:
#!/usr/bin/env bash
PKG_OK=$(dpkg-query -W --showformat='${Status}\n' wget|grep "install ok installed")
echo Checking for wget: $PKG_OK
if [ "" == "$PKG_OK" ]; then
echo "wget not found. Setting up wget."
sudo apt-get --force-yes --yes install wget
fi
sudo wget -O /usr/bin/cls https://git.io/v7u2q
sudo wget -O /usr/share/man/man1/cls.1.gz https://git.io/v7u2c
@sam-irl
sam-irl / error-parsing.java
Created August 16, 2017 01:25
How to parse errors in Java
catch(Exception e) {
System.err.println("An error occured! Searching the most complete archive of programming questions and answers ever compiled.");
java.awt.Desktop.getDesktop().browse(java.net.URI.create("https://stackoverflow.com/search?q=" + e.getStackTrace()));
}