Skip to content

Instantly share code, notes, and snippets.

❗️
5 assignments overdue

Sam, IRL sam-irl

❗️
5 assignments overdue
  • hell
Block or report user

Report or block sam-irl

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
@sam-irl
sam-irl / error-parsing.java
Created Aug 16, 2017
How to parse errors in Java
View error-parsing.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()));
}
View install-cls.sh
#!/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 / snakecoin-server-full-code.py
Last active Jul 24, 2017 — 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.
View snakecoin-server-full-code.py
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:
@sam-irl
sam-irl / Enchantments.java
Last active Jul 18, 2017
List of enchantments and their options for names
View Enchantments.java
// 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":
You can’t perform that action at this time.