Skip to content

Instantly share code, notes, and snippets.

View NateSeymour's full-sized avatar

Nathan Seymour NateSeymour

  • Chicago, Illinois
  • 21:00 (UTC -05:00)
View GitHub Profile
async function myMessage() {
sleep(1000);
console.log('My message');
}
myMessage();
console.log('I like javascript');
/* output
I like javascript
function myMessage() {
sleep(1000); // Theoretical function that makes the script wait 1000ms
console.log('My message');
}
myMessage();
console.log('I like javascript');
/* output
My message
@NateSeymour
NateSeymour / hello.s
Created July 18, 2019 20:11
hello.s - read "infinitely" long user input from stdin and display it
# hello.s - read "infinitely" long user input from stdin and display it
# Error codes
# err_open - 0x0
# err_close - 0x1
.data
# Text constants
greeting: .asciz "Hello, what is your name?\n"
@NateSeymour
NateSeymour / x86macasm_rdm_number.s
Created July 16, 2019 20:03
Random number generator in x86 MacOS assembly (AT&T) syntax
# The most awesome, awe inspiring random number generator ever
# Error codes:
# 0x0 - Could not open file
# 0x1 - No bytes read from file
.bss
.data
output: .asciz "Random number: %i \n"
@NateSeymour
NateSeymour / Promise.h
Created March 11, 2019 21:23
Javascript promises recreated in C++
#pragma once
#include <mutex>
namespace js {
template<class C> class Promise
{
public:
bool failure = false;
std::exception exception;