Skip to content

Instantly share code, notes, and snippets.

View TFlexSoom's full-sized avatar
🃏
Playing Magic

Tristan Hilbert TFlexSoom

🃏
Playing Magic
View GitHub Profile
@TFlexSoom
TFlexSoom / sum_of_pkt_lengths
Created May 14, 2019 18:41
This is a quick and dirty printing program requiring a JSON from Wireshark including all of the packet seperations and their details.
/* number of POST TCP packet within Wireshark*/
const starting_num = 4;
/* filname of json file with './' */
const data = require("./actual-trace-data");
const len = data.length;
//console.log("== Contents \n" + JSON.stringify(data) + "\n===========================");
var sum = 0;
@TFlexSoom
TFlexSoom / kitty.html
Created July 17, 2019 16:12
Kitty Website Example
<!DOCTYPE HTML>
<head>
<title>Kitty Time!</title>
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<body>
<div id="background">
<div class="row">
<img class="kitty" src="http://4.bp.blogspot.com/-_vTDmo_fSTw/T3YTV0AfGiI/AAAAAAAAAX4/Zjh2HaoU5Zo/s1600/beautiful+kitten.jpg">
<img class="kitty" src="https://www.rspcasa.org.au/wp-content/uploads/2019/01/Adopt-a-cat-or-kitten-from-RSPCA.jpg">
@TFlexSoom
TFlexSoom / twitchAPIExample.html
Created February 11, 2020 22:34
Instead of using the curl command example you may also use AJAX with javascript. It will be different from Java, but it will provide what you need!
<!DOCTYPE html>
<head>
<script>
var CLIENT_ID = ""
function sendRequest(){
}
if(CLIENT_ID === ""){
@TFlexSoom
TFlexSoom / RandomCellMatrix.py
Created February 18, 2020 02:04
Getting Random Number From Matrix With Different Length Rows
# Tristan Hilbert
# 2/17/2020
# 1 []
# 2 []
# 3 [1, 2]
import random
example = [
@TFlexSoom
TFlexSoom / gist:7df23eb6179292c10b515cb10538c57e
Created February 18, 2020 02:39
setsExamplePrinting.py
import random
# SET
# GOOD: 1 2 3 4 5 6 7 8
# BAD: 1 1 1 2 3 4 5 => 1 2 3 4 5
# Good: "hello", "Hello", "H3ll0"
# derp = codesters.Sprite("ufo")
# derp1 = derp
# Good: derp
var obsCooldown = 40;
var obstacleSpawner = obsCooldown;
function updateGameState() {
scrollSpeed += 0.001
// update player position and velocity
player.y += player.y_velocity
if (player.y >= groundLevel - PLAYER_SIZE) { // touching ground?
player.y = groundLevel - PLAYER_SIZE;
@TFlexSoom
TFlexSoom / text_rpg.py
Last active April 3, 2020 16:13
text_rpg minimum file for cool base classes and boilerplate code.
# Tristan Hilbert
# Text RPG Engine
import random
class Character:
def __init__(self):
self.name = "default"
self.health = 100
@TFlexSoom
TFlexSoom / ExampleMod.java
Created May 15, 2020 21:28
Example Mod With a For Loop For command!
package com.example.examplemod;
import net.minecraft.block.Block;
import net.minecraft.block.Blocks;
import net.minecraft.entity.player.ServerPlayerEntity;
import net.minecraft.server.MinecraftServer;
import net.minecraft.util.text.StringTextComponent;
import net.minecraft.util.text.TextComponent;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.CommandEvent;
@TFlexSoom
TFlexSoom / Counting Sum
Created May 20, 2020 23:21
A Gist For A CWK class warmup
# Get a positive number from the user
pos_num_str = input("Give Me A Positive Number")
# pos_num_str is a string when we obtain it.
# it must be "casted" to a number
pos_num = int(pos_num_str)
# Add up all numbers between 1 and that number
@TFlexSoom
TFlexSoom / Looping Through Lists and Strings Examples CWK
Created May 20, 2020 23:51
This shows some examples of way to loop through lists and strings using for.
lst = []
lst.append(1)
lst.append(2)
lst.append(3)
lst.append(4)
lst.append(5)
print(lst)
var = "hello"