Skip to content

Instantly share code, notes, and snippets.

View gmemstr's full-sized avatar
πŸ³οΈβ€πŸŒˆ
Free hugs!

Gabriel Simmer gmemstr

πŸ³οΈβ€πŸŒˆ
Free hugs!
View GitHub Profile

Active Online Reporting

Basic Idea

Use websockets for reporting server uptime, where the panel acts as a "client" and the main monitor instance acts as a "server". A websocket connection is made between the two, in affect allowing real time statistics to flow through from "client server" to "master server" to "client" on the web front end and keeping accurate stats cached in cases of disabled JavaScript or API calls.

Advantages

  • Don't need to rely on requests

LFS

I'm looking for a reliable server, preferably from a reputable company.

I've looked at a few options but can't decide on one or another, so I figure I'll leave it to whoever reads this.

Requirements:

  • At least 4 cores
  • 4+ GB/RAM
setInterval(RequestStat, 1000);
var table = document.getElementById("table");
var i=1;
function RequestStat() {
if (document.getElementById("rts").checked == true) {
console.log(i);
var row = table.rows[i];
var panel = row.id;
console.log(row);
@gmemstr
gmemstr / Java.md
Last active January 29, 2017 22:16

Java 101

So you want to learn how to program Java? Well let's jump right in to this crash course.

First a few things to know. This is a crash course designed to get the basics of Java into your head. This will not be a comprehensive review of everything there is to know about Java. Also, we'll be dealing a lot with reading and deconstructing code, so make sure you have Eclipse (eclipse neon) installed along with the latest version of the JDK (8u121).

First Code Example

You can create a new projecy by opening eclipse and going to File -> New -> Java Project. This is where all of your source files (.java files that contain the source code) will reside. Name it CrashCourse and click Finish. Now open up the CrashCourse folder and right click on the src folder which was automatically created. Create a New -> Package. The naming convention of Java packages is typicall

@gmemstr
gmemstr / Cache.py
Created January 23, 2017 23:25
Caching to JSON file in Python
# Updated cache script based on mcadmin.
# Includes timelog toggle so dates are not
# logged at all.
import json
import time
def Stash(data, filename, timelog=True):
today = time.strftime("%x")
@gmemstr
gmemstr / CompetitiveRank.py
Created December 23, 2016 16:28
Algorithm for calculating fair competitive ranking points for Overwatch (wip)
#
# Overwatch Competitive Rank Point Algorithm ^TM ^^Copyright ^^^etc.
# Written by Gabriel Simmer, December 2016
# Feel free to use this script in your own
# projects, just make sure to provide some attribution
# back to either this gist or my GitHub. <3
#
def Calculate(time, points, deaths, elims, wins, lost):
@gmemstr
gmemstr / settings.json
Created December 13, 2016 00:15
Personal vsCode settings file.
// Place your settings in this file to overwrite the default settings
{
// Editor
"editor.fontFamily": "'Monaco'",
"editor.fontSize": 12.5,
"editor.roundedSelection": false,
"editor.formatOnType": true,
"editor.formatOnSave": true,
"editor.cursorStyle": "underline",
"editor.folding": false,
// Function to retrieve token
function tvdbToken() {
var url = "https://api.thetvdb.com/login";
var payload = JSON.stringify({
"apikey": "YOUR_TVDB_API_KEY"
});
var headers = {
"content-type": "application/json"
}
import requests
import xml.etree.ElementTree as ET
import json
bots_total = 89
bots_price = 0
bots_individual = ""
i = 1
while i < bots_total:
@gmemstr
gmemstr / skeleton-grid.css
Created July 1, 2016 18:54
Skeleton's Grid System
/* Pulled from Skeleton by dhg https://github.com/dhg/Skeleton/
Literally just the grid system and small utilities,
you're expected to write your own CSS. */
/* Grid
–––––––––––––––––––––––––––––––––––––––––––––––––– */
.container {
position: relative;
width: 100%;