Skip to content

Instantly share code, notes, and snippets.

@isopen
isopen / arm_tdjson_example.s
Created October 23, 2025 18:09
TDLib ARM Client in ARM32 Assembly (ARMv7)
// TDLib ARM Client in ARM32 Assembly (ARMv7)
//
// https://gist.github.com/isopen/2be1547e3e98a053cbc3a26851a5ebcd
// docker build -t tdlib-arm-app .
// docker run -it --rm tdlib-arm-app
.section .data
// Error messages
lib_error: .asciz "Error: libtdjson.so not found\n"
client_error: .asciz "Error: Failed to create client\n"
@isopen
isopen / Dockerfile
Last active October 24, 2025 02:36
TDLib ARM Client in ARM32 Assembly (ARMv7)
FROM debian:bullseye
ENV DEBIAN_FRONTEND=noninteractive
RUN dpkg --add-architecture armhf && \
apt update && \
apt install -y --no-install-recommends \
libc6:armhf \
libstdc++6:armhf \
ca-certificates \
@isopen
isopen / gas_tdjson_example.s
Last active October 21, 2025 07:29
gas_tdjson_example.s
# TDLib Minimal Linux Client in x86-64 GNU Assembler
#
# as -o gas_tdjson_example.o gas_tdjson_example.s
# gcc -o gas_tdjson_example gas_tdjson_example.o -ldl -no-pie
# ./gas_tdjson_example
.section .data
# Error messages
lib_error: .asciz "Error: libtdjson.so not found\n"
client_error: .asciz "Error: Failed to create client\n"
@isopen
isopen / nasm_tdjson_example.asm
Created September 21, 2025 11:17
nasm_tdjson_example
; TDLib Minimal Linux Client in x86-64 Assembly (NASM)
;
; nasm -f elf64 -o nasm_tdjson_example.o nasm_tdjson_example.asm
; gcc -o nasm_tdjson_example nasm_tdjson_example.o -ldl -no-pie
; ./nasm_tdjson_example
section .data
; Error messages
lib_error db "Error: libtdjson.so not found", 10, 0
client_error db "Error: Failed to create client", 10, 0
() recv_external(slice in_msg) impure {
var signature = in_msg~load_bits(512);
var cs = in_msg;
var (msg_seqno, valid_until, stored_seqno, public_key) = (cs~load_uint(32), cs~load_uint(32), get_data().begin_parse().load_uint(32), get_data().begin_parse().load_uint(256));
throw_if(35, valid_until <= now());
throw_unless(33, msg_seqno == stored_seqno);
throw_unless(34, check_signature(slice_hash(in_msg), signature, public_key));
accept_message();
cs~touch();
while (cs.slice_refs()) {
I. TON Ducks
1.
video: https://t.me/tonplay_chat/271/1229
I wanted to set a new world record for TON Ducks, but under the onslaught of two bulls, "Duck" flew into textures.
I think you need to check the field bounds check in TON Ducks (validation doesn't always work).
2.
- video: https://t.me/tonplay_chat/271/1155
AI is not very good at avoiding obstacles as I mentioned above, but then it turned out that his damage does not blow boxes.
<?php
...
/**
* https://github.com/yiisoft/yii/issues/1197
*
* @param bool $resetDefault
*
* @return $this|GxActiveRecord
*/
public function resetScope($resetDefault = true)
@isopen
isopen / categories.rb
Created December 13, 2019 10:21
if scripts are executed sequentially, then remove the static dependency calls
...
nod_bench = Benchmark.measure do
input_file = ...
...
@isopen
isopen / news.rb
Created December 12, 2019 21:50
hot)fix
...
lang.each do |section|
articles = Utils.get_articles(json, section)
next unless articles
...
end
...
<?php
use Symfony\Component\HttpFoundation\Session\SessionInterface;
class AppDefaultAuthenticator extends AbstractGuardAuthenticator implements AuthenticatorInterface
{
...
private $session;
...
public function __construct(SessionInterface $session) {