View true.s
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
; this > GNU's coreutils true | |
global _start | |
_start: | |
mov eax, 1 | |
int 0x80 |
View isPrime.c
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 <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 gist:aeb5a71a65869069958e55c92cc82e56
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 _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 |
View truefalse.s
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
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 yes.asm
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
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 yes.c
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
/* | |
* Produce a continuous stream of `y's | |
* or `n's. | |
*/ | |
#include <stdio.h> | |
main(argc, argv) | |
char *argv[]; | |
{ |
View init.s
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
BITS 64 | |
CPU X64 | |
section .text | |
global _start | |
%macro mount 3 | |
mov rax, 0x53 ; sys_mkdir | |
mov rdi, %1 ; location | |
mov rsi, %3 ; mode |
View moose.js
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
#!/usr/bin/env node | |
const reladate = require('relative-date'), | |
https = require('https'); | |
const mooseShade = { | |
0: '\x1b[47mâ–‘', | |
1: '\x1b[47mâ–’', | |
2: '\x1b[47mâ–“', | |
3: 'â–ˆ', |