Skip to content

Instantly share code, notes, and snippets.

View DarkMio's full-sized avatar

Mio Bambino DarkMio

View GitHub Profile
@DarkMio
DarkMio / steamfinder.py
Last active December 31, 2015 09:43
This checks the steam search api for keywords. Feed it with a wordlist (a list of words, each keyword (can be space seperated) in a new line). Should work with \c, \c\r and \r). Needs Requests, works best with Python3.
import requests
app_id = 0 # enter some AppID first.
url = "http://store.steampowered.com/actions/clues"
with open('wordlist.txt' as 'r') as f:
words = f.readlines()
// Go through all words - if the last character is a newline, truncate
words = [word[:-1] for word in words if word[-1] is '\n']
for word in words:
@DarkMio
DarkMio / RenolPy3 Idea Sheet.md
Last active February 6, 2016 13:30
I should update that.

Great ideas from shitty minds

General

  • On Disconnect Renol should not crash anymore
  • Banning / allowing should be natively integrated (core), rather being a plugin
  • Maybe look what can be achieved with CTCP requests for client verification or ignoring webclients
  • Split up logging files for: System, Commands, IRC Logs
  • Maybe apply lessons-learnt from RedditRover for a web interface (???)
  • Write incredibly clean and documented code.
pattern_lines = """
f 1 2 3
f 1/2 3/4 5/6
f 1//2 3//4 5//6
f 1/2/3 4/5/6 7/8/9
"""
for pattern in pattern_lines.splitlines():
if pattern.beginsWith("f"):
line_begins_with_f(pattern)
class Drawbale {
public:
virtual void draw() const = 0;
};
class A : Drawable {
virtual void draw() const { /*...*/ }
};
class B : Drawable {
virtual void draw() const { /*...*/ }
};
@DarkMio
DarkMio / greenscreen.cginc
Created October 16, 2017 09:59
Basic Chroma Keying HLSL Shader
float _Tolerance;
float _Threshold;
// Color Space Conversions can be found here:
// http://www.poynton.com/PDFs/coloureq.pdf
// http://dougkerr.net/Pumpkin/articles/CIE_XYZ.pdf
// cn -> color normalization
float cnRGB2XYZ(float val) {
if(val > 0.04045) {
return pow((val + 0.055) / 1.055, 2.4);
}

Command Patterns for Kraken

Message Types

By the looks of it, the Kraken X62 communicates by two command types:

  • 0x02 Control Command
  • 0x04 Status Command

There is a third message pattern, which has yet to be determined what it does. To be frank, it is a fixed value, it makes numerically no sense to me right now.

float4 hsv2rgb(float4 c)
{
float4 K = float4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);
float3 p = abs(frac(c.xxx + K.xyz) * 6.0 - K.www);
return float4(c.z * lerp(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y), c.a);
}
let parse = (entry) => {
const op = entry.match(/(?<op>.*) (?<value>.*)/).groups;
return {
cnt: 0,
op: op.op,
value: parseInt(op.value)
}
}
let runProgram = (program) => {
@DarkMio
DarkMio / gooboo-literature-solver.js
Last active May 3, 2024 19:34
Gooboo School Math Solver
const cancel = (() => {
const handle = setInterval(() => {
const element = document.querySelector(".v-text-field__slot > input");
const questionElement = document.querySelector(".question-text > :nth-child(1)");
if(!element || !questionElement) {
return;
}
const text = questionElement.innerText.replaceAll('_', ' ');
element.value = text;