Skip to content

Instantly share code, notes, and snippets.

View diazvictor's full-sized avatar
✍️
Haciendo realidad mi imaginación....

Víctor Díaz diazvictor

✍️
Haciendo realidad mi imaginación....
View GitHub Profile
@diazvictor
diazvictor / filetypes.Less.conf
Created March 22, 2021 05:26
LESS Filetype For Geany
# For complete documentation of this file, please see Geany's main documentation
[styling=CSS]
[keywords=CSS]
[lexer_properties=CSS]
lexer.css.less.language=1
[settings]
lexer_filetype=CSS
@diazvictor
diazvictor / InventoryGame.php
Last active March 7, 2021 06:41
Small Example Of A Game Inventory With PHP
<?php
// 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
public function __construct() {
$this->items = array();
}
/**
@diazvictor
diazvictor / InventoryGame.moon
Last active February 28, 2021 05:45
Small Example Of A Game Inventory With MoonScript
-- 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
@diazvictor
diazvictor / GtkClock.lua
Created February 24, 2021 08:36
A simple clock with LGI (Lua + GTK)
--[[--
@desc A simple clock with LGI (Lua + GTK)
@author Díaz Urbaneja Víctor Eduardo Diex <[email protected]>
@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')
@diazvictor
diazvictor / PathsLGI.md
Last active November 25, 2023 06:39
Paths of standard files of a GTK project for LGI.

Paths of standard files of a GTK project for LGI.

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/
@diazvictor
diazvictor / WidgetMessages.lua
Last active February 20, 2021 08:53
Widget To Display Messages ("For" And "From") With LGI (Lua + GTK)
--[[
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')
@diazvictor
diazvictor / InventoryGame.js
Last active July 15, 2024 18:58
Small Example Of A Game Inventory With Javascript
/* 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 = [];
}
@diazvictor
diazvictor / CreatingObjects.js
Created February 18, 2021 19:58
How To Create An Object With Javascript
// 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 () {
@diazvictor
diazvictor / PlaceholderTextView.lua
Created February 16, 2021 16:09
How To Set Placeholder Text in Gtk.TextView With LGI (Lua + Gtk)
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,
{
@diazvictor
diazvictor / ToggleDarkMode.lua
Created February 12, 2021 06:11
How to change to dark theme of an application with LGI (Lua + GTK)
-- 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"
}