Skip to content

Instantly share code, notes, and snippets.

View JustLinuxUser's full-sized avatar

Andrii JustLinuxUser

  • Madrid
  • 17:58 (UTC +01:00)
View GitHub Profile
@JustLinuxUser
JustLinuxUser / quine_updated.as
Created February 15, 2025 16:53
A quine that follows 42 dr quine rules in under 50 loc
; A dumb comment
global _start
msg: db "global _start",10,"msg: db |",10,"newline_seq: db 34, 44, 49, 48, 44, 34, 0",10,"end_seq: db 34, 44, 48, 0",10,"ft_putchar_real: ; recieves a str ptr, in rsi, only prints the first char",10," mov rax, 1 ; write syscall",10," mov rdi, 1 ; fd 1",10," mov rdx, 1 ; 1 byte",10," syscall ",10," ret",10,"_start:",10," mov rsi, msg",10," call main ; Call the main function, then exit",10," mov rax, 60 ; exit syscall",10," mov rdi, 0 ; status 0",10," syscall",10,"main:; gets input from rsi",10," cmp byte [rsi], 124 ; if is a pipe symbol",10," jne skip ; start of print_escaped",10," push rsi ; save rsi",10," mov rsi, end_seq ; use the first char of that string",10," call ft_putchar_real; print one semi colon",10," mov rsi, msg ; start printing the formatted str",10," loop2:",10," cmp byte [rsi], 10",10," jne skip_format_newline ; if newline",10," push rsi",10," mov rsi, newline_seq",10," call main",10,"
global _start
msg: db "global _start",10,"msg: db |",10,"newline_seq: db 34, 44, 49, 48, 44, 34, 0",10,"end_seq: db 34, 44, 48, 0",10,"ft_putchar_real: ; recieves a str ptr, in rsi, only prints the first char",10," mov rax, 1 ; write syscall",10," mov rdi, 1 ; fd 1",10," mov rdx, 1 ; 1 byte",10," syscall ",10," ret",10,"_start:",10," mov rsi, msg",10," call putstr ; Call the main function, then exit",10," mov rax, 60 ; exit syscall",10," mov rdi, 0 ; status 0",10," syscall",10,"putstr:; gets input from rsi",10," cmp byte [rsi], 124 ; if is a pipe symbol",10," jne skip ; start of print_escaped",10," push rsi ; save rsi",10," mov rsi, end_seq ; use the first char of that string",10," call ft_putchar_real; print one semi colon",10," mov rsi, msg ; start printing the formatted str",10," loop2:",10," cmp byte [rsi], 10",10," jne skip_format_newline ; if newline",10," push rsi",10," mov rsi, newline_seq",10," call putstr",10," pop rsi",
#!/bin/bash
# set -x
test_number=0;
ptest () {
test_number=$(($test_number + 1))
echo $test_number
./push_swap $1 &> out
res=$(cat out | ./checker $1 2>&1)
res2=$(cat out | ./checker_linux $1 2>&1)
package main
import (
"fmt"
"time"
"github.com/gorilla/schema"
)
type TestStruct struct {
Time time.Time
// ==UserScript==
// @name New Userscript
// @namespace http://tampermonkey.net/
// @version 2024-12-20
// @description try to take over the world!
// @author You
// @match *://www.preciosadictos.com/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=preciosadictos.com
// @grant none
// ==/UserScript==
return {
"mfussenegger/nvim-lint",
cmd = function()
BANNED_BUFFS = {};
require("lint").linters_by_ft = {
c = { "norminette" },
}
-- Error: VAR_DECL_START_FUNC (line: 171, col: 1): Variable declaration not at start of function
local pattern = '(Error):%s+([%u_]+)%s+%(line:%s+(%d+),%scol:%s+(%d+)%):%s+(.*)';
vim.o.tabstop = 4 -- A TAB character looks like 4 spaces
vim.o.expandtab = false -- Pressing the TAB key will insert spaces instead of a TAB character
vim.o.softtabstop = 0 -- Number of spaces inserted instead of a TAB character
vim.o.shiftwidth = 4 -- Number of spaces inserted when indenting
vim.o.listchars = "tab:⇥ ,eol:󰘌,trail:■"
vim.g.mapleader = " " -- Leader key
vim.o.nu = true
vim.o.rnu = true
vim.o.undofile = true
vim.o.cmdheight = 0
<!DOCTYPE html>
<html>
<head>
<title>Accounting with Xander :)</title>
<script src="/assets/htmx.min.js"></script>
<script src="/assets/tailwind.js"></script>
</head>
<body class="flex flex-col justify-center">
<h1>{{w.full_name}}</h1>
<form hx-put="/api/submit_report" hx-target="#result" hx-swap="none">
What to do when you have a Cargo.lock merge conflict?
1. `git checkout origin/main -- Cargo.lock` to get the original Cargo.lock
2. `cargo build` to update Cargo.lock
3. `git add Cargo.lock`
4. continue the merge as normal
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
void ft_advanced_sort_string_tab(char **tab, int (*cmp)(const char *, const char *))
{
int i;
int j;
char *temp;