Skip to content

Instantly share code, notes, and snippets.

View krissemicolon's full-sized avatar

Kris Huber krissemicolon

View GitHub Profile
@krissemicolon
krissemicolon / spot_orderbook.py
Created December 17, 2024 20:57 — forked from btschwertfeger/spot_orderbook.py
A realtime order book for trading Spot on the Kraken cryptocurrency exchange using the pyhton-kraken-sdk
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2023 Benjamin Thomas Schwertfeger
# GitHub: https://github.com/btschwertfeger
#
"""
This module provides an example on how to use the Spot websocket
client of the python-kraken-sdk (https://github.com/btschwertfeger/python-kraken-sdk)
to retrieve and maintain a valid Spot order book for a specific
@krissemicolon
krissemicolon / sha256-hash-nodejs-browser.js
Created December 17, 2024 09:35 — forked from acdcjunior/sha256-hash-nodejs-browser.js
Generate sha256 hash for a buffer - browser and node.js
/*
* Sometimes you want to hash stuff on the client and on the server to test if
* data transmission is happening okay. These functions to that.
*/
// node.js
import crypto from 'node:crypto';
async function calculateHashForArrayBuffer(data: ArrayBuffer) {
@krissemicolon
krissemicolon / emacsCoreCommands.md
Created April 21, 2024 20:07 — forked from k2052/emacsCoreCommands.md
Emacs Shortcuts + Commands

Emacs Commands

Text

  • C-f: move cursor forward one char
  • C-b: mover cursor back one chart
  • C-n: mover cursor to next line
  • C-p: go to previous line
  • M-f: forward one word
  • M-b: move backward one word
@krissemicolon
krissemicolon / Q_rsqrt.c
Created February 12, 2024 19:08
Quake III's fast inverse square root
#include <math.h>
#include <stdio.h>
float Q_rsqrt( float number )
{
long i;
float x2, y;
const float threehalfs = 1.5F;
x2 = number * 0.5F;
%:include <stdio.h>
int main()
{<%{<%{<%{<%{<%{<%{<%{<%{<%{<%{<%
<%<%<%puts("hello, world");%>%>%>
}%>}%>}%>}%>}%>}%>}%>}%>}%>}%>}%>

Keybase proof

I hereby claim:

  • I am krissemicolon on github.
  • I am krissemicolon (https://keybase.io/krissemicolon) on keybase.
  • I have a public key whose fingerprint is F77C 71F8 EA91 77AF 27CC BA45 1B82 D510 089E 3432

To claim this, I am signing this object:

4AkqW3mvKPFSGFSBhdgKkd71E3E9QY1siCZHQgxryMSFWjGdAz2eW2s4YfLaUqKHeiZxVjLcGDaBGEFGkAF1GmKWTSkQJBz
<script>
alert("XSS");
</script>
pub fn xor(text: &str, key: u8) -> String {
text.chars().map(|c| ((c as u8) ^ key) as char).collect()
}
#include <stdio.h>
#include <stdlib.h>
typedef struct _node {
int data;
struct _node *next;
} node;
typedef struct {
node *head;