This file contains 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 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: |
This file contains 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 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" \ |
This file contains 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 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" |
This file contains 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 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. |
This file contains 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 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. |
This file contains 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
#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) |
This file contains 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 python3 | |
# -*- coding: UTF-8 -*- | |
""" | |
Convert String into Array of Strings. | |
""" | |
from http import server | |
from socketserver import ThreadingMixIn | |
from hello_world import hello, world |
This file contains 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
#include <iostream> | |
#include <cstring> | |
void string_split(const char *text, const char *delimiter, char *tokens[10]); | |
int main() { | |
// Convert String into Array of Strings. | |
// Managing memory is usually a feat. | |
// Furthermore, execute in terminal: `g++ main.cpp -o strings-c`. | |
const char *text = "a/apple/arm/basket/bread/car/camp/element/..."; |
This file contains 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 python3 | |
# -*- coding: UTF-8 -*- | |
""" | |
Convert String into Array of Strings. | |
""" | |
from doctest import testmod | |
# Press CTR+Q to see the documentation. | |
def string_split(text: str, delimiter: str) -> list[str]: |
This file contains 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
#include <iostream> | |
#include <cstring> | |
int main() { | |
// Convert String into Array of Strings. | |
// Managing memory is usually a feat. | |
// Furthermore, execute in terminal: `g++ main.cpp -o strings-c`. | |
const char *text = "a/apple/arm/basket/bread/car/camp/element/..."; | |
char split_char = '/'; | |
char *token, *str, *toFree; |
NewerOlder