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
//FightCode can only understand your robot | |
//if its class is called Robot | |
var Robot = function(robot) { | |
}; | |
Robot.prototype.onIdle = function(ev) { | |
var robot; | |
robot = ev.robot; | |
robot.ahead(150); |
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
parse_git_branch() { | |
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/' -e 's/^[ \t]*//' | |
} | |
export PS1="\[\033[36m\]\u\[\033[m\]:\[\033[33;1m\]\w\[\033[m\]:\[\033[00m\]\[\033[31m\]\$(parse_git_branch)\[\033[m\]\$ " | |
export CLICOLOR=1 | |
export LSCOLORS=GxFxBxDxCxegedabagacad | |
alias ls='ls -GFh' | |
# Git aliases |
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
# remap prefix from 'C-b' to 'C-a' | |
unbind C-b | |
set-option -g prefix C-a | |
bind-key C-a send-prefix | |
# split panes using | and - | |
bind | split-window -h | |
bind - split-window -v | |
unbind '"' | |
unbind % |
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
package main | |
import ( | |
"fmt" | |
"strconv" | |
) | |
func main() { | |
consts := []int64{672274793, 85072278, 369367448, 537993216} | |
for _, c := range consts { |
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 <fcntl.h> | |
#include "tlpi_hdr.h" | |
#include "error_functions.c" | |
#include "get_num.c" | |
int main(int argc, char *argv[]) | |
{ | |
int outputFd, openFlags; | |
mode_t filePerms; | |
off_t offset; |
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
int i, holes = 0; | |
while ((numRead = read(inputFd, buf, BUF_SIZE)) > 0) | |
{ | |
if (keepHoles == 1) { | |
for (i = 0; i < numRead; i++) { | |
if (buf[i] == '\0') { | |
holes++; | |
continue; | |
} else if (holes > 0) { | |
lseek(outputFd, holes, SEEK_CUR); |
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 <malloc.h> | |
#include <stdlib.h> | |
int main(int argc, char *argv[]) { | |
malloc(atoi(argv[1])); | |
} |
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
void * | |
_malloc(size_t size) | |
{ | |
void *block_mem; | |
block_t *ptr, *newptr; | |
size_t alloc_size = size >= ALLOC_UNIT ? size + sizeof(block_t) | |
: ALLOC_UNIT; | |
ptr = head; | |
while (ptr) { | |
if (ptr->size >= size + sizeof(block_t)) { |
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
/* scan_merge scans the free list in order to find | |
* continuous free blocks that can be merged and also | |
* checks if our last free block ends where the program | |
* break is. If it does, and the free block is larger then | |
* MIN_DEALLOC then the block is released to the OS, by | |
* calling brk to set the program break to the begin of | |
* the block */ | |
void | |
scan_merge() | |
{ |
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
Verifying that "andrestc.id" is my Blockstack ID. https://onename.com/andrestc |
OlderNewer