This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use bevy::{ | |
ecs::{ | |
bundle::{BundleEffect, DynamicBundle}, | |
component::{ | |
ComponentId, Components, ComponentsRegistrator, RequiredComponents, StorageType, | |
}, | |
}, | |
prelude::*, | |
ptr::OwningPtr, | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// [dependencies] | |
/// calloop = "0.10.5" | |
/// | |
/// TODO: in the current implementation when you add a new handler | |
/// inside another handler | |
/// and then emit an event before all handlers have been called | |
/// the new handler will be called twice | |
/// gotta think about how to fix that | |
use std::cell::{ RefCell, RefMut }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from typing import Iterator, Optional | |
checked = set() | |
def check_inst(i: HighLevelILInstruction, const: int) -> Iterator[HighLevelILInstruction]: | |
if isinstance(i, Constant) and i.constant == const: yield i | |
for o in filter(lambda i: isinstance(i,HighLevelILInstruction), i.operands): | |
yield from check_inst(o, const) | |
def check_func(f: Function, const: int, depth_max: int, depth: int = 0) -> Iterator[HighLevelILInstruction]: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
compiles an asm file into a c-style byte array | |
#> | |
param ( | |
# path to asm file | |
[parameter(mandatory=$true)] | |
[string]$path | |
) | |
$nasm = "$env:LOCALAPPDATA\bin\NASM\nasm.exe" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# this is specific to the v8 js engine | |
# firefox actually does something slightly different so their encodings are incompatible | |
import sys | |
import math | |
import string | |
from functools import reduce | |
import numpy as np | |
from numpy import float64 as f64 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local function doc(string) | |
return setmetatable({doc = string}, { | |
__concat = function(t, f) | |
if type(f) == 'function' | |
then t.func = f; return t | |
else f.doc = t.doc .. '\n' .. f.doc; return f | |
end | |
end, | |
__call = function(t, ...) return t.func(...) end | |
}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; challange: | |
; -------------------- | |
; Challenge #3 | |
; -------------------- | |
; Caesar Cipher | |
; | |
; You may know also this as ROT N. | |
; Your solution should input an arbitrary ROT cipher encoded string and output all shifts. | |
; The allowed alphabet is [a-zA-Z] any other characters are not shifted and output as is | |
; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def switch(target, dict): | |
for k, v in dict.items(): | |
# could add pattern matching memes here | |
# instead of just equals | |
# or maybe the key could be a callable too which will return true or false | |
# that kinda would just be an if tho | |
if k == target: | |
v(target) | |
break |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::io; | |
use std::ptr; | |
use std::mem; | |
use std::io::Error; | |
use std::io::ErrorKind; | |
use std::path::Path; | |
use std::ffi::CString; | |
use winapi::um::winnt::HANDLE; | |
use winapi::um::memoryapi as wmem; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<body> | |
<script> | |
w = window.open('', '_system', 'width=1, height=1'); | |
var q = '<html><head><title>kektop</title></head><body>kektop</body></html>' | |
w.document.body.innerHTML = q; | |
</script> | |
<body> | |
</html> |
NewerOlder