Skip to content

Instantly share code, notes, and snippets.

View GabrielModog's full-sized avatar
🤠

Gabriel Tavares GabrielModog

🤠
View GitHub Profile
@GabrielModog
GabrielModog / texteditor.py
Created October 1, 2017 04:53
# A massive junk editor write in python
# gorgeous text editor made by @GabrielModog 01/10/2017
from tkinter import *
from tkinter import filedialog
from tkinter.filedialog import asksaveasfile
from tkinter.filedialog import askopenfile
filename = None
def newFile():
global filename
@GabrielModog
GabrielModog / fizzbuzz.lua
Created August 29, 2017 20:35
pratice is everything.
-- @GabrielModog in 08/29/2017 17:00 just a pratice.
--[[
function random_number(n, nmax)
math.randomseed(os.time())
local random = math.floor(math.random(nmax))
return random
end
function magic()
local values = random_number(100, 1000)
-- TODO: A simple game
love.graphics.setDefaultFilter("nearest", "nearest")
love.graphics.setNewFont(15)
local MAX = 150
function love.load()
listRect = {}
listCircles = {}
end
function createCircles()
@GabrielModog
GabrielModog / lightish.lua
Last active November 14, 2019 00:07
LIGHTISH [version 0.1] - @GabrielModg | 09/08/2017 - 04:50 | inspiration by Tron | Love2D 9.2 Engine
-- LIGHTISH [version 0.1] - @GabrielModg | 09/08/2017 - 04:50 | inspiration by Tron | Love2D 9.2 Engine
function love.load()
love.window.setMode(800, 600)
love.window.setTitle("Ligthish")
love.graphics.setNewFont(15)
debugOn = true
gW = love.graphics.getWidth()
gH = love.graphics.getHeight()
width = gW / 2 - 100
@GabrielModog
GabrielModog / cout.lua
Created July 10, 2017 15:06
"cout simulator in Lua" || std::cout << cout.lua << std::endl; ||
-- @GabrielModog || cout <iostream> C++ shit ||
cout = function(str) if str ~= nil then io.write(tostring(str), " ") else io.write("\n") end
return cout
end
rectangle = {area = 0, length = 0, breadth = 0}
function rectangle:new (o, length, breadth)
o = o or {}
setmetatable(o, self)
self.__index = self
self.length = length or 0
self.breadth = breadth or 0
self.area = length * breadth
return o
@GabrielModog
GabrielModog / PointersTricks.txt
Last active September 14, 2023 06:41
C Pointers Tricks
https://www.quora.com/In-C-or-C++-what-are-your-favorite-pointer-tricks
https://www.codeproject.com/Articles/82880/C-Pointer-Tricks
http://www.ioccc.org/
https://gcc.gnu.org/onlinedocs/gcc/Function-Attributes.html
https://gcc.gnu.org/onlinedocs/gcc/Variable-Attributes.html
https://gcc.gnu.org/onlinedocs/gcc/Type-Attributes.html
@GabrielModog
GabrielModog / LinkedList.c
Last active June 25, 2017 14:19
Incomplete Linked List system for C
#include <stdio.h>
#include <stdlib.h>
struct node{
int x;
struct node *next;
};
int main(void){
@GabrielModog
GabrielModog / ForEach.c
Created June 21, 2017 02:38
foreach C like extension
#include <stdio.h>
// write by @GabrielModog to some test and experimental shit
typedef struct list_node list_node;
struct list_node{
list_node *next;
void *data;
};
#define FOR_EACH(item, list)\
@GabrielModog
GabrielModog / SwapTheFirstWithTheLast.lua
Last active September 14, 2023 06:41
Swap the first number in array to the last one.
-- @GabrielModog -- Swap the first number in array to the last one.
arr = {15, 3, 4, 7, 11}
i = 1
last = #arr
if arr[i] < arr[last] then
arr[i], arr[last] = arr[last], arr[i]
goto done