This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set-option global indentwidth 0 | |
set-option global scrolloff 10,10 | |
set-option -remove global autocomplete prompt|insert | |
set-option -add global ui_options terminal_assistant=none | |
set-option -add global ui_options terminal_enable_mouse=true | |
set-option global makecmd '' | |
# hooks | |
hook global WinCreate ^[^*]+$ %{editorconfig-load} | |
hook global BufCreate .+\.lua %{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env lua | |
-- | |
-- System battery notifier ;) | |
-- | |
sleep = function(sec) | |
os.execute("sleep " .. sec) | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env lua | |
-- | |
-- Copyright (c) 2023 Gabriel G. de Brito | |
-- | |
-- Permission is hereby granted, free of charge, to any person obtaining a copy | |
-- of this software and associated documentation files (the "Software"), to deal | |
-- in the Software without restriction, including without limitation the rights | |
-- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
-- copies of the Software, and to permit persons to whom the Software is |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env lua | |
-- | |
-- Copyright (c) 2023 Gabriel G. de Brito | |
-- | |
-- Permission is hereby granted, free of charge, to any person obtaining a copy | |
-- of this software and associated documentation files (the "Software"), to deal | |
-- in the Software without restriction, including without limitation the rights | |
-- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
-- copies of the Software, and to permit persons to whom the Software is |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef __HTML_MACROS | |
#define __HTML_MACROS | |
#define HTML(l, head, body) <!DOCTYPE html> \ | |
<html lang=#l> \ | |
head \ | |
body \ | |
</html> | |
#define HEAD(...) <head> \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import "net/http" | |
func main() { | |
port := ":6969" | |
handler := http.FileServer(http.Dir(".")) | |
http.ListenAndServe(port, handler) | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef __DRW_INCLUDED | |
#define __DRW_INCLUDED | |
/* | |
* drw.h - Header-only library for easy X11 text-oriented graphics. | |
*/ | |
/* | |
* Copyright (C) 2023 Gabriel de Brito | |
* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import "core:fmt" | |
import "core:os" | |
import "core:strconv" | |
import "core:strings" | |
panic_read :: proc() { | |
fmt.eprintln("cannot read from stdin") | |
os.exit(1) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-module(calc). | |
-export([main_loop/1]). | |
read_tokens() -> | |
case io:get_line("calc> ") of | |
[] -> []; | |
L -> string:tokens(lists:droplast(L), " ") | |
end. | |
exec_token(S, T) -> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule Calc do | |
defp exec_op(_, "clear"), do: [] | |
defp exec_op([fa | [fb | r]], token) do | |
case token do | |
"+" -> [fa + fb | r] | |
"-" -> [fa - fb | r] | |
"*" -> [fa * fb | r] | |
"/" -> [fa / fb | r] | |
"swap" -> [fb | [fa | r]] | |
end |