Skip to content

Instantly share code, notes, and snippets.

Kenneth B. Jensen kjensenxz

Block or report user

Report or block kjensenxz

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@kjensenxz
kjensenxz / moose.js
Created May 13, 2018
CLI client for adedomin/neomoose
View moose.js
#!/usr/bin/env node
const reladate = require('relative-date'),
https = require('https');
const mooseShade = {
0: '\x1b[47mâ–‘',
1: '\x1b[47mâ–’',
2: '\x1b[47mâ–“',
3: 'â–ˆ',
View init.s
BITS 64
CPU X64
section .text
global _start
%macro mount 3
mov rax, 0x53 ; sys_mkdir
mov rdi, %1 ; location
mov rsi, %3 ; mode
@kjensenxz
kjensenxz / yes.c
Created Jun 13, 2017
COHERENT Unix's yes, c. 2001
View yes.c
/*
* Produce a continuous stream of `y's
* or `n's.
*/
#include <stdio.h>
main(argc, argv)
char *argv[];
{
View yes.asm
BITS 64
CPU X64
global _start
section .text
_start:
inc rdi ; stdout, will not change after syscall
mov rsi, y ; will not change after syscall
mov rdx, 8192 ; will not change after syscall
View truefalse.s
BITS 64
CPU X64
section .text
global _start
_start:
dec ecx ; counter register used for repnz
pop rdi ; throw away argc, could be not 1
pop rdi ; get argv[0]
View gist:aeb5a71a65869069958e55c92cc82e56
global _start
_start:
add edx, 1
cmp byte [msg + edx], 0
jne _start
mov eax, 4 ; sys_write
mov ebx, 1 ; to stdout
mov ecx, msg
; edx already contains number of bytes
@kjensenxz
kjensenxz / isPrime.c
Last active Nov 5, 2016
/dpt/ told me to
View isPrime.c
#include <math.h>
int isPrime(int n) {
int mask = n >> 31;
n = (mask ^ n) - mask;
if (n < 4) return 1;
else if (!(n & 1)) return 0;
unsigned short i;
for (i = 3; i <= sqrt(n); i+=2) {
View true.s
; this > GNU's coreutils true
global _start
_start:
mov eax, 1
int 0x80
You can’t perform that action at this time.