This file contains 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
global strclr | |
extern printf | |
extern malloc | |
section .text | |
strclr: | |
sub rsp, 8 | |
; callee reserved registers | |
push rbx |
This file contains 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
#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. |
This file contains 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
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 |
This file contains 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
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) |
This file contains 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
ssh alex@$(nmap -sn 192.168.1.0/24 | grep fatima | awk '{ print $6 }' | sed -e 's/(\|)//g') |
This file contains 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
global main | |
extern printf | |
SECTION .text | |
small_enough: | |
mov rax, 1 | |
add rsi, 1 | |
;rdi array, rsi array length, rdx limit | |
loop: |
This file contains 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
import urllib.request | |
from bs4 import BeautifulSoup | |
quotes = [] | |
for i in range(10_000): | |
try: | |
fp = urllib.request.urlopen("https://www.cockbox.org") | |
cockbytes = fp.read() | |
cockstr = cockbytes.decode("utf8") |
This file contains 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
#!/bin/bash | |
git push 2> /dev/null | |
if [ $? -eq 128 ] | |
then | |
$(git push 2>&1 \ | |
| grep 'git push') 2>&1 \ | |
| grep https \ | |
| awk '{ print $2 }' \ | |
| xargs firefox |
This file contains 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
#lang racket/base | |
; unit tests | |
(require rackunit) | |
; Give (eval expr namespace) access to | |
; the current namespace via the label ns | |
(define-namespace-anchor a) | |
(define ns (namespace-anchor->namespace a)) | |
This file contains 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
class BinaryTree: | |
left = None | |
right = None | |
value = None | |
def __init__(self, *initial): | |
self.value = initial.pop(0) | |
for i in initial: | |
self.add(i) |