screenshots
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
---Converts a function with callback into coroutine-style wait. | |
---This function accepts a function which a "resolver" function | |
---is passed as the only argument. | |
---When this "resolver" function is called, control is yielded | |
---back to the user. | |
---@param fn fun(...: any): ...any | |
---@returns ...any | |
local function await(fn) | |
local co = coroutine.running() | |
local ret |
Here is a brief tutorial on how to open your Ubuntu files like any other Windows folder. The way we'll achieve this is by adding a Host-Only network adapter.
I'm not an expert.
I am not an expert in networking and can barely fix anything. Don't quote me on this.
A computer network is just like a dorm. Each computer has an address (how to find them).
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
! Sensible defaults (https://aduros.com/blog/xterm-its-better-than-you-thought) | |
XTerm*locale: false | |
XTerm*utf8: true | |
XTerm*scrollTtyOutput: false | |
XTerm*scrollKey: true | |
XTerm*bellIsUrgent: true | |
XTerm*metaSendsEscape: true | |
! Styling |
This is Comic Mono patched with -s
flag so it'll be picked up by programs that only want monospace fonts.
Check comment for download.
- Fedora XFCE (seamless mode only works on X11 currently)
- Setup shared folder (for Guest->Host communication):
C:\
->/mnt/c
%USERPROFILE%\Documents
->~/winhome
- Use NAT and a Host-Only Adapter (Or bridged on vmware. Trust me, it'll save a lot of time)
- Setup sshfs-win for Host->Guest access (or see below for smb configuration)
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 mouse=a | |
set number | |
set hidden | |
set clipboard+=unnamedplus | |
" install vimplug if not available | |
let data_dir = has('nvim') ? stdpath('data') . '/site' : '~/.vim' | |
if empty(glob(data_dir . '/autoload/plug.vim')) | |
silent execute '!curl -fLo '.data_dir.'/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim' | |
autocmd VimEnter * PlugInstall --sync | source $MYVIMRC |
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
-- Very simple arg parser | |
local function resolve(tbl, key) | |
if type(tbl[key]) == "string" then return resolve(tbl, tbl[key]) else return key end | |
end | |
local function consume_long(optlist, stack, opt) | |
local key, value = string.match(opt, "^([%w-_]+)=?(.*)$") | |
local cast = assert(optlist[key], "invalid parameter --" .. key) | |
if cast == true then |
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
local Trie = {} | |
Trie.__index = Trie | |
function Trie:__tostring() | |
return "Trie" | |
end | |
function Trie:__call(...) | |
local obj = setmetatable({}, self) | |
obj:new(...) |
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
--[[ | |
Promises fully contained in a function. | |
This function returns a promise where you can resolve/reject just like in JS. | |
Example use case: | |
--- | |
local promise = make_promise() | |
http.get(url, function(data) promise:resolve(data) end) | |
promise | |
:next(function(data) return json.parse(data) end) | |
:catch(function(err) print(err) end) |
NewerOlder