Skip to content

Instantly share code, notes, and snippets.

View xbelanch's full-sized avatar
🏠
Working from home

Xavier Belanche Alonso xbelanch

🏠
Working from home
  • Xavier Belanche
  • World Wide Trash
  • X @xbelanch
View GitHub Profile
@vratiu
vratiu / .bash_aliases
Last active May 6, 2024 17:58
Git shell coloring
# Customize BASH PS1 prompt to show current GIT repository and branch.
# by Mike Stewart - http://MediaDoneRight.com
# SETUP CONSTANTS
# Bunch-o-predefined colors. Makes reading code easier than escape sequences.
# I don't remember where I found this. o_O
# Reset
Color_Off="\[\033[0m\]" # Text Reset
@zloedi
zloedi / roguelike_FOV.c
Last active April 19, 2024 20:02
Efficient roguelike grid FOV / shadowcasting / line of sight in a single C function inspired by https://docs.microsoft.com/en-us/archive/blogs/ericlippert/shadowcasting-in-c-part-one
// Copyright (c) 2021 Stoiko Todorov
// This work is licensed under the terms of the MIT license.
// For a copy, see https://opensource.org/licenses/MIT.
// What this function does:
// Rasterizes a single Field Of View octant on a grid, similar to the way
// field of view / line of sight / shadowcasting is implemented in some
// roguelikes.
// Uses rays to define visible volumes instead of tracing lines from origin
// to pixels.
@pascalpoitras
pascalpoitras / config.md
Last active May 7, 2024 14:03
My WeeChat configuration

WeeChat Screenshot

Mouse


enable


@1wErt3r
1wErt3r / SMBDIS.ASM
Created November 9, 2012 22:27
A Comprehensive Super Mario Bros. Disassembly
;SMBDIS.ASM - A COMPREHENSIVE SUPER MARIO BROS. DISASSEMBLY
;by doppelganger (doppelheathen@gmail.com)
;This file is provided for your own use as-is. It will require the character rom data
;and an iNES file header to get it to work.
;There are so many people I have to thank for this, that taking all the credit for
;myself would be an unforgivable act of arrogance. Without their help this would
;probably not be possible. So I thank all the peeps in the nesdev scene whose insight into
;the 6502 and the NES helped me learn how it works (you guys know who you are, there's no
@salmonmoose
salmonmoose / bresenham3d.py
Created May 21, 2012 00:44
Generate unit locations along a 3D line
def bresenham(startPoint, endPoint):
startPoint = [int(startPoint[0]),int(startPoint[1]),int(startPoint[2])]
endPoint = [int(endPoint[0]),int(endPoint[1]),int(endPoint[2])]
steepXY = (abs(endPoint[1] - startPoint[1]) > abs(endPoint[0] - startPoint[0]))
if(steepXY):
startPoint[0], startPoint[1] = startPoint[1], startPoint[0]
endPoint[0], endPoint[1] = endPoint[1], endPoint[0]
@wilson
wilson / config
Created November 21, 2010 20:51
irssi config for gtalk using irssi-xmpp plugin
# in $HOME/.irssi/startup, put: load xmpp on a line by itself
settings = {
"fe-common/xmpp" = {
xmpp_status_window = "yes";
xmpp_send_composing = "no";
};
"xmpp/core" = { xmpp_set_nick_as_username = "yes"; };
};
servers = {
@nolim1t
nolim1t / socket.c
Created June 10, 2009 03:14
HTTP Request in C using low level write to socket functionality
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
#include <netinet/tcp.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <netinet/in.h>