Skip to content

Instantly share code, notes, and snippets.

View maavelar5's full-sized avatar

Marco Avelar maavelar5

View GitHub Profile
@maavelar5
maavelar5 / main.cc
Created March 30, 2021 22:46
Useless Bits Of Code - Graphical Cat-less
#include <cassert>
#include <ctime>
#include <fstream>
#include <iostream>
#include <map>
#include <string>
#include <vector>
#include <SDL2/SDL.h>
#include <SDL2/SDL_image.h>
@maavelar5
maavelar5 / dmenu.el
Created November 1, 2020 04:35
emacs + dmenu
(setq dmenu-cfg " | dmenu -i -l 20 -p .")
(defun dmenu-ag ()
(interactive)
(setq my_shell_output (shell-command-to-string (concat "ag . " dmenu-cfg)))
(setq splitted (split-string my_shell_output ":"))
(when (> (length splitted) 1)
(find-file (car splitted))
@maavelar5
maavelar5 / main.cpp
Last active February 16, 2019 17:16
SDL2 + C++ Creating a window
#include <SDL2/SDL.h>
int main (int argc , char **argv)
{
SDL_Window* window = nullptr;
// This initializes the SDL library
SDL_Init( SDL_INIT_VIDEO );
// SDL_CreateWindow ( title , x , y , w , h , flags );