Skip to content

Instantly share code, notes, and snippets.

View airvzxf's full-sized avatar

Israel Roldan airvzxf

View GitHub Profile
@airvzxf
airvzxf / terminal-colors.bash
Last active August 29, 2023 00:19
Show the terminal colors.
#!/usr/bin/env bash
# Change the font styles and the background color:
declare -a FIRST_POSITION=(0 1 2 4 5 6 8 9)
declare -a SECOND_POSITION=(30 31 32 33 34 35 36 37
40 41 42 43 44 45 46 47
90 91 92 93 94 95 96 97
100 101 102 103 104 105 106 107)
# To change the colors of the foreground and background, uncomment the variables:
@airvzxf
airvzxf / github-remove-and-make-release.bash
Created August 6, 2023 07:42
In GitHub it remove all the actions, tags and releases. Furthermore, it create a new release. It use the 'gh' command-line tool.
#!/usr/bin/env bash
set +xve
RELEASE_TAG='v1.0.0'
REPOSITORY_ID='airvzxf/archlinux-brightness-xrandr'
GITHUB_ACTIONS=$(
gh api \
-H "Accept: application/vnd.github+json" \
-H "X-GitHub-Api-Version: 2022-11-28" \
@airvzxf
airvzxf / ls-chars.bash
Last active July 28, 2023 20:29
Given a font, it will display all the character sets it contains.
#!/usr/bin/env bash
# Thanks for this code Lu Xu.
# https://stackoverflow.com/a/60475015/1727383
# Make this file executable.
# chmod u+x ls-chars.bash
# Usage:
# ./ls-chars.bash "FontAwesome"
@airvzxf
airvzxf / xmllint-xmlns-solution.bash
Last active July 25, 2023 15:09
xmllint xmlns error using the XPath
#!/usr/bin/env bash
set -vx
# chmod u+x xmllint-xmlns-solution.bash
# Execute: ./xmllint-xmlns-solution.bash
# DESCRIPTION
# The xmllint program parses one or more XML files, specified on the command line as XML-FILE (or the standard input if the
# filename provided is - ). It prints various types of output, depending upon the options selected. It is useful for detecting
# errors both in XML code and in the XML parser itself.
@airvzxf
airvzxf / match-words-in-phrases.py
Last active March 3, 2023 21:56
Match words in phrases. If the words is in the phrase returns true and print the phrase, otherwise it return false and print anything.
#!/usr/bin/env python3
# -*- coding: UTF-8 -*-
"""
Given a text, it detects a serie of words and return true if it finds some of these.
"""
def match_words(text: str, words: list) -> bool:
"""
Detect if the text contains the words from the first and second list.
@airvzxf
airvzxf / MoneyFunctionIndependent.py
Created November 28, 2022 16:17
Tutorial de hackeo de videojuegos en Linux. Ejemplo de una supuesta funcionalidad de una función que decrece el dinero.
"""
Handle all the player class
"""
class EnemyPlayer:
"""
Handler the enemy player
"""
@airvzxf
airvzxf / MoneyFunctionShared.py
Created November 28, 2022 16:18
Tutorial de hackeo de videojuegos en Linux. Ejemplo de una supuesta funcionalidad de una función que decrece el dinero.
"""
Handle all the player class
"""
class Player:
"""
Player class
"""
@airvzxf
airvzxf / MoneyFunctionNotClass.py
Created November 28, 2022 16:18
Tutorial de hackeo de videojuegos en Linux. Ejemplo de una supuesta funcionalidad de una función que decrece el dinero.
"""
Esta funcion simula el juego al perder dinero pero esta programada con funciones
"""
def decrease_money(money: int, amount: int):
"""
Decrease player money given an amount.
:type money: int
:param money: Total of money
#include <sys/socket.h> // For socket functions
#include <netinet/in.h> // For sockaddr_in
#include <cstdlib> // For exit() and EXIT_FAILURE
#include <iostream> // For cout
#include <unistd.h> // For read
// Compile: `g++ main.cpp -o web-service-c`
// Usage: `telnet localhost 8002`
int main() {
// Create a socket (IPv4, TCP)
#!/usr/bin/env python3
# -*- coding: UTF-8 -*-
"""
Convert String into Array of Strings.
"""
from http import server
from socketserver import ThreadingMixIn
from hello_world import hello, world