Skip to content

Instantly share code, notes, and snippets.

@bejado
bejado / floodfill.m
Last active Oct 13, 2017
C interview question for Snap Inc.
View floodfill.m
#import <Foundation/Foundation.h>
static const int GRID_WIDTH = 10;
static const int GRID_HEIGHT = 10;
void printGrid(bool grid[GRID_WIDTH][GRID_HEIGHT]) {
for (int row = 0; row < GRID_HEIGHT; row++) {
for (int col = 0; col < GRID_WIDTH; col++) {
printf(grid[row][col] ? "x" : ".");
}
View .zshrc
# Base 16 terminal
BASE16_SHELL=$HOME/.config/base16-shell/
[ -n "$PS1" ] && [ -s $BASE16_SHELL/profile_helper.sh ] && eval "$($BASE16_SHELL/profile_helper.sh)"
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH=/Users/benjamin.doherty/.oh-my-zsh
View minimal_boot_assembly.asm
;
; A minimal boot sector that prints a 'Hello, world' message
;
; Initialize the stack pointer to the address 0x8000
mov bp, 0x8000
mov sp, bp
; Our boot sector has been loaded into memory at 0x7c00
; Set our es segment register to 0x07c0