Skip to content

Instantly share code, notes, and snippets.

View Andre-LA's full-sized avatar

André L. Alvares Andre-LA

View GitHub Profile
@Andre-LA
Andre-LA / estilos.css
Last active September 1, 2020 23:10
HTML-basico em lpages
-- estilos/estilos.css
html {
font-family: "Roboto Slab", sans-serif;
background-color: #00539F;
color: #461f02;
}
body {
width: 600px;
margin: 0 auto;
@Andre-LA
Andre-LA / nelua_trait_example.lua
Last active December 15, 2020 18:45
nelua trait example
-- based from https://github.com/edubart/nelua-lang/blob/master/lib/allocators/interface.nelua
-- a trait impl. can be just a macro which should receive a record as parameter
## local function sum_fields_trait(R)
-- ensure that the argument is really a record
##[[ staticassert(
R and R.value and R.value.is_record,
"parameter passed to 'sum_fields' is not a record"
)]]
@Andre-LA
Andre-LA / libmylib.c
Last active October 17, 2022 11:46
nelua as C library
/* Generated by Nelua 0.2.0-dev */
/* Compile command: gcc "libmylib.c" -o "libmylib" -Wall -fwrapv -g -lm */
/* Compile hash: 3ubsTFvAUFqRHss7xDS1yGaiVwdM */
/* ------------------------------ DECLARATIONS ------------------------------ */
// moved to here:
#ifndef MYLIB_H
#define MYLIB_H
#ifdef __GNUC__
#pragma GCC diagnostic error "-Wimplicit-function-declaration"
@Andre-LA
Andre-LA / language_nelua.lua
Last active June 25, 2022 21:07
nelua language syntax highlighting to tile-xl
-- mod-version:2 -- lite-xl 2.0
-- IMPORTANT NOTE:
-- This file it's just an archive, if you want to use nelua in lite-xl, use this instead:
-- https://github.com/AbdulKalam21/nelua-lite-xl/
-- to better understand these comments, see this section from rxi's article
-- https://rxi.github.io/lite_an_implementation_overview.html#syntax_highlighting
-- first, we need to require the syntax module
-- add modules compiled with luarocks on lua path (see the pallene file for details)
-- just replace YOUR_USER_HERE with your username
package.cpath = package.cpath .. ';/home/dreunix/.luarocks/lib/lua/5.4/?.so'
local teste = require 'codes.teste'
-- below the actual experiment, this is a port from Lua-SDL2 tutorial:
-- https://github.com/Tangent128/luasdl2/blob/master/tutorials/02-window/tutorial.lua
--
@Andre-LA
Andre-LA / handles.lua
Created March 2, 2023 19:25
nelua "Handles"
local Button = @record{
text: string,
on_mouse_down: function(btn: *Button, x: integer, y: integer),
}
## Button.value.is_widget = true -- related doc: https://nelua.io/overview/#specializing-concepts-for-records
-- let's create an alias to make this easier
local OnMouseDownCallback = @function(btn: *Button, x: integer, y: integer)
-- note: we don't need the `&` operator when binding a function to a variable/field, because