Skip to content

Instantly share code, notes, and snippets.

View seisvelas's full-sized avatar
🦊
const sh = network.pop(shell); sh.write({recipient:'admin'}, 'nice system!');

Xandre V seisvelas

🦊
const sh = network.pop(shell); sh.write({recipient:'admin'}, 'nice system!');
View GitHub Profile
@seisvelas
seisvelas / groupByChipset.js
Last active March 2, 2021 00:32
Group by chipset object problem
//Given an array of VIZIO TV models, create a "groupByChipset" function
//that aggregates the model names by their "chipset" field:
//Example input:
const tvs = [
{
"modelName": "VIZIO D24f-F1",
"chipset": "5581"
},
{
"modelName": "VIZIO V405-H9",
@seisvelas
seisvelas / clock.py
Created February 21, 2021 00:33
Create pie chart from Clockify
import matplotlib.pyplot as plt
import seaborn as sns
import pandas as pd
from sys import argv
sns.set()
def load_tasks(dataframe):
del dataframe['Project']
del dataframe['Client']
@seisvelas
seisvelas / dequeue_stocks.py
Created February 2, 2021 07:27
Solution to cassidoo newsletter stock thing
def stockQueue(snapshot):
dequeued_snapshot = {
stock['sym']:stock['cost'] for stock in snapshot
}
return [
{
'sym':stock,
'cost': cost
} for stock, cost in dequeued_snapshot.items()
@seisvelas
seisvelas / move_icon.gd
Created January 18, 2021 02:40
Move and slice Godot script for Pancho
extends KinematicBody2D
var motion = Vector2()
func _physics_process(_delta):
motion.y += 10
if Input.is_action_pressed("ui_right"):
motion.x = 200
elif Input.is_action_pressed("ui_left"):
@seisvelas
seisvelas / backspace.asm
Last active December 27, 2020 03:22
String with backspaces function in ASM - broken because I can't correctly move one byte between two pointers
global strclr
extern printf
extern malloc
section .text
strclr:
sub rsp, 8
; callee reserved registers
push rbx
@seisvelas
seisvelas / function_ptr_VERSUS_label_addr.c
Last active December 25, 2020 08:36
Is a function pointer just the address of the label?
#include <stdio.h>
#include <stdint.h>
/*
Test whether a function pointer is really just
a pointer to the memory location of a label.
Which would make sense, only I never really looked
into function pointers, so I'm curious if this is
what they are.
@seisvelas
seisvelas / bus.asm
Last active December 24, 2020 08:49
Solution to the bus toy problem Khety created for me
global busString
extern sprintf
section .data
busStringFormat: db "%ld more people are allowed onto the bus.", 10, 0
busOutOfSpace: db "No more people can fit on the bus.", 10, 0
section .bss
output_buff: resb 5000
@seisvelas
seisvelas / fib_recur.asm
Last active December 13, 2020 08:26
x64 implementation of the f(n)=f(n-1)+f(n-2) fibonacci algorithm
global fibonacci
extern printf
fibonacci:
xor rax, rax
; f(n = 1|0) = n
cmp rdi, 1
jle identity
; f(n > 1) = f(n - 1) + f(n - 2)
@seisvelas
seisvelas / khety_ssh.sh
Created December 8, 2020 04:58
Script for Khety to easily SSH into Fatima's laptop with my user
ssh alex@$(nmap -sn 192.168.1.0/24 | grep fatima | awk '{ print $6 }' | sed -e 's/(\|)//g')
@seisvelas
seisvelas / less.asm
Created December 3, 2020 06:06
assembly toy problem
global main
extern printf
SECTION .text
small_enough:
mov rax, 1
add rsi, 1
;rdi array, rsi array length, rdx limit
loop: