This information has been collected by observing the GNOME projects. Especially those of PGI
com.github.project
is the name of your project.
com.github.project/
├── data/
│ ├── appdata/
-- I create the Inventory class | |
class Inventory | |
-- What to do when the class is initialized | |
new: => | |
@items = {} | |
--- I look at what I carry in my inventory. | |
-- @return bool true or false if there are items. | |
getItem: => | |
if #@items != 0 then |
--[[-- | |
@desc A simple clock with LGI (Lua + GTK) | |
@author Díaz Urbaneja Víctor Eduardo Diex <victor.vector008@gmail.com> | |
@date 23.02.2021 03:57:22 -04 | |
]] | |
-- I require the LGI libraries | |
local lgi = require('lgi') | |
local Gtk = lgi.require('Gtk', '3.0') | |
local GLib = lgi.require('GLib', '2.0') |
--[[ | |
These widgets are used in the MoonZaphire project <https://github.com/diazvictor/MoonZaphire/> | |
@date 20.02.2021 04:12:56 -04 | |
]] | |
-- I require the LGI libraries | |
local lgi = require('lgi') | |
local Gtk = lgi.require('Gtk', '3.0') | |
local GLib = lgi.require('GLib', '2.0') |
/* jshint esversion: 8 */ | |
// This example is a port of: https://gist.github.com/diazvictor/6fe3372bce79587a3c21123a19881cb1 | |
// I create the Inventory class | |
class Inventory { | |
// What to do when the class is initialized | |
constructor() { | |
this.items = []; | |
} |
// This is a practice of the <https://www.sololearn.com/learning/1024/> course. | |
var currentDate = new Date(); | |
function person (name, age) { | |
this.name = name; | |
this.age = age; | |
this.yearOfBirth = currentDate.getFullYear() - this.age; | |
this.seeInfo = function () { |
local lgi = require('lgi') | |
local Gtk = lgi.require('Gtk', '3.0') | |
--- Some widgets were added to keep the initial focus on others. | |
local window = Gtk.Window { | |
title = 'TextView With Placeholder', | |
width = 400, | |
height = 400, | |
window_position = Gtk.WindowPosition.CENTER, | |
{ |
-- I require LGI | |
local lgi = require("lgi") | |
local Gtk = lgi.require("Gtk", "3.0") | |
-- I create the application | |
local app = Gtk.Application { | |
-- The application ID | |
application_id = "com.gists.github.diazvictor.ToggleDarkMode" | |
} |
-- This is a port of GistsScrapper.go <https://gist.github.com/M1que4s/b92073803b658c207fbdfaebc10a1512> | |
local curl = require('cURL') -- <https://github.com/Lua-cURL/Lua-cURLv3> | |
local feedparser = require('feedparser') -- <https://github.com/slact/lua-feedparser> | |
file_exist = function (file) | |
local file_found = io.open(file, "r") | |
if (file_found == nil) then | |
return false | |
end |
-- This is a port of Bytes.go <https://gist.github.com/M1que4s/70965ab7ea03d85f43a379e0860d86eb> | |
function check(err, msg, ...) | |
local msg = string.format(msg, ...) | |
if err ~= nil then | |
print(msg) | |
return err | |
end | |
end |