Skip to content

Instantly share code, notes, and snippets.

View mauro-balades's full-sized avatar
😪
Focusing

mauro 🤙 mauro-balades

😪
Focusing
View GitHub Profile
@mauro-balades
mauro-balades / format.sh
Last active March 6, 2023 16:23
Format your C++ projects
# note (1): remember to change the ".cpp" to the extension (and the path) you want formatted
# note (2): this works with header files too
find src/**/*.cpp | xargs clang-format -i -style="{IndentWidth: 4,TabWidth: 4}"
@mauro-balades
mauro-balades / readme.md
Last active March 6, 2023 04:39
Recent activity 👇

❗️ Opened issue #8 in Basl-Language/Basl-Compiler ❗️ Opened issue #1 in DaOnlyOwner/Hyc ❗️ Opened issue #1 in ScriptQuest/repo 🗣 Commented on #5 in Fuechs/Fux ❗️ Opened issue #5 in Fuechs/Fux

@mauro-balades
mauro-balades / main.c
Last active February 26, 2023 11:19
Represent a number with value "1"
#include <stdio.h>
int main() {
int num=++*(*(unsigned int(*)[1])(unsigned int[]){0}+!(*(unsigned char*)(&((unsigned int*)0)[1])))<<((!(sizeof(int)%2))?16:0);
printf("num is now %d",num);
return 0;
}
@mauro-balades
mauro-balades / index.md
Last active January 17, 2023 11:18
Why machinarium is great

Introduction

Machinarium is a point ‘n’ click adventure game that obligate players to use logic in order to proceed with the story. It takes around 3-4 hours (that's what it took me to complet it) and those 3 hours where filled with amazing discoveries. The game allows the player to discover more about the main character (commonly known as "Josef" by the community) and how he got in he's current situation.

Josef does not want to conquer the world, he just wants to reclaim his original state and have a good life with his girlfriend. For him to achieve him his goals, he must help other first and the ones he helped would return the favour. Machinarium is a good example of games that wants to transmit a message to it's player base and also about how a game can use some techniques to make it feel more inmersive and atrackt the user into wanting to discover more about the story.

Machinarium was published on 2009 along with other games such as call of duty. This made it difficult for it to expand on it's

@mauro-balades
mauro-balades / safe_code.hpp
Last active October 12, 2022 14:35
Things to commit just before leaving your job
// Just before switching jobs:
// Add one of these.
// Preferably into the same commit where you do a large merge.
//
// This is an "extension" for https://gist.github.com/aras-p/6224951
#define ; ; // not a semi colon >:)
#define union struct
#define true (2 & 3 == 2)
@mauro-balades
mauro-balades / basic.cpp
Created April 14, 2022 19:44
Run BASIC code in c++
#ifndef __BASIC_CPP_H__
#define __BASIC_CPP_H__
#define DO {
#define END }
#define IF(x) if (x)
#define ELSE } else
@mauro-balades
mauro-balades / bf.c
Created January 1, 2022 11:45 — forked from lifthrasiir/bf.c
/* The world's smallest Brainfuck interpreter in C, by Kang Seonghoon
* http://j.mearie.org/post/1181041789/brainfuck-interpreter-in-2-lines-of-c */
s[99],*r=s,*d,c;main(a,b){char*v=1[d=b];for(;c=*v++%93;)for(b=c&2,b=c%7?a&&(c&17
?c&1?(*r+=b-1):(r+=b-1):syscall(4-!b,b,r,1),0):v;b&&c|a**r;v=d)main(!c,&a);d=v;}
@mauro-balades
mauro-balades / ANSI-color-codes.h
Last active April 21, 2022 01:57 — forked from RabaDabaDoba/ANSI-color-codes.h
The entire table of ANSI color codes working in C!
/*
* This is free and unencumbered software released into the public domain.
*
* For more information, please refer to <https://unlicense.org>
*/
#ifndef __ANSI_COLOR_CODES_H_
#define __ANSI_COLOR_CODES_H_
//Regular text
@mauro-balades
mauro-balades / SCSS.md
Created April 20, 2022 15:17 — forked from jareware/SCSS.md
Advanced SCSS, or, 16 cool things you may not have known your stylesheets could do

⇐ back to the gist-blog at jrw.fi

Advanced SCSS

Or, 16 cool things you may not have known your stylesheets could do. I'd rather have kept it to a nice round number like 10, but they just kept coming. Sorry.

I've been using SCSS/SASS for most of my styling work since 2009, and I'm a huge fan of Compass (by the great @chriseppstein). It really helped many of us through the darkest cross-browser crap. Even though browsers are increasingly playing nice with CSS, another problem has become very topical: managing the complexity in stylesheets as our in-browser apps get larger and larger. SCSS is an indispensable tool for dealing with this.

This isn't an introduction to the language by a long shot; many things probably won't make sense unless you have some SCSS under your belt already. That said, if you're not yet comfy with the basics, check out the aweso

@mauro-balades
mauro-balades / debug.hpp
Created April 2, 2022 11:10 — forked from Tagussan/debug.hpp
C++ debug header. Use -DDBUG_ option when compiling. Many thanks for https://www.creativ.xyz/dump-cpp-652/
#include <iostream>
#include <map>
#include <set>
#include <string>
#include <vector>
using namespace std;
#define repi(itr, ds) for (auto itr = ds.begin(); itr != ds.end(); itr++)