Skip to content

Instantly share code, notes, and snippets.

View deathmarine's full-sized avatar

Josh deathmarine

  • Lansing, MI
View GitHub Profile
public ChatColor getFirstColor(String s){
char[] c = s.toCharArray();
for(int i=0;i<c.length;i++){
if(c[i]==new Character((char)167)&&i+1<c.length){
return ChatColor.getByChar(c[i+1]);
}
}
return null;
}
@deathmarine
deathmarine / gist:7436430
Last active December 28, 2015 03:39
Procyon Wrapper
import java.io.File;
import java.io.IOException;
import java.io.StringWriter;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Scanner;
import com.strobel.assembler.InputTypeLoader;
@deathmarine
deathmarine / gist:553602b43483e59554c54999a18d89d4
Last active June 24, 2016 20:19
Tampermonkey Vacation Countdown
// ==UserScript==
// @name Vacation Countdown
// @namespace http://tampermonkey.net/
// @version 0.1
// @description GTFO Counter!
// @author You
// @match *://*/*
// @grant none
// ==/UserScript==
@deathmarine
deathmarine / rad_watch.ino
Created May 25, 2017 18:51
Radiation Watch Sketch, Serial 115200, 10Hz Totalized
int sON = 0;
int nON = 0;
int signPin = 2; //Radiation Pulse (White)
int noisePin = 5; //Vibration Noise Pulse (Yellow)
int signCount;
int noiseCount = 0;
int prevTime = 0;
boolean latch;
void setup() {
@deathmarine
deathmarine / miner.sh
Last active May 24, 2018 14:08
Headless Ethminer Bash Script
#!/usr/bin/env bash
# -----------------------------------------------------------------------------
# File : miner.sh
# Project : https://github.com/
# Updated Author: @Deathmarine
# Original Author: @AndreaLanfranchi
# Original Project: https://github.com/ethereum-mining/ethminer/issues/1063#issuecomment-386667125
# -----------------------------------------------------------------------------
# Description
@deathmarine
deathmarine / Main.java
Created October 10, 2018 19:53
Test Script
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.util.ArrayList;
import java.util.List;
import com.fazecast.jSerialComm.SerialPort;
public class Main implements Runnable{
static boolean RUNNING = true;
@deathmarine
deathmarine / example.java
Created May 1, 2019 01:50
Check for win method
public boolean checkForWin(int index) {
//TO DO: check to see if there is a winner. If so, set win field and return true; otherwise, return false
if(gameArray[0] == gameArray[1] && gameArray[1] == gameArray[2])
win = Win.TOP_ROW; // Could probably do this with a case switch
if(gameArray[0] == gameArray[3] && gameArray[3] == gameArray[6])
win = Win.TOP_ROW; // Could probably do this with a case switch
//Blah... If statement
//More If statements
int count = 0;
public boolean changeToken(int index) {
// make sure this space is blank, if not return
if (gameArray[index] != Token.Blank) {
System.out.println("Space is already used");
return false;
}
@deathmarine
deathmarine / Program.cs
Created November 22, 2019 15:00
100 line Keno Game in C#
using System;
using System.Collections;
using System.Text.RegularExpressions;
namespace KenoProject {
class Program {
static void Main(string[] args) {
Random generator = new Random();
Console.WriteLine("======= Play Keno =======\n\n");
while (true) {
@deathmarine
deathmarine / NLtoNC_IconChanger.user.js
Last active November 25, 2019 16:58
NordLocker to Nextcloud Icon Change
// ==UserScript==
// @name NextCloud NordLocker Update
// @namespace http://none/
// @version 0.1
// @description Add NordLocker Icons to NextCloud Folders
// @author Deathmarine
// @match https://*/nextcloud/index.php/apps/files/*
// @grant none
// ==/UserScript==