Skip to content

Instantly share code, notes, and snippets.

View ryukinix's full-sized avatar
☢️
IN RESEARCH

Manoel V. Machado ryukinix

☢️
IN RESEARCH
View GitHub Profile
"""
Download a remote playlist as m3u from server.manoel.dev to watch by streaming.
Example
-------
> python downloadplaylist.py https://server.manoel.dev/extra_animes/Serial%20Experiments%20Lain/
Will write a serial-experiments-lain.m3u
@ryukinix
ryukinix / find-executable.lisp
Last active August 19, 2025 05:46
find-executable in Common Lisp
(defun executables ()
(loop with path = (uiop:getenv "PATH")
for p in (uiop:split-string path :separator ":")
for dir = (probe-file p)
when (uiop:directory-exists-p dir)
append (uiop:directory-files dir)))
(defun find-executable (name)
(find name (executables)
:test #'equalp
#!/bin/bash
# dump screenshots to telegram and delete from filesystem
set -e
get-pictures() {
# get screenshots
find /mnt/mmc/Roms /mnt/sdcard/Roms -type f -regex ".*-[0-9]+-[0-9]+.png\$"
}
@ryukinix
ryukinix / kmp-substring-search.lisp
Created July 13, 2017 16:01
KMP substring problem implementation on Common Lisp
;; kmp-fp: Substring Search @ HackerRank
;; Date: Thu 13 Jul 2017 08:48:40 AM -03
;; Manoel Vilela
;; NOTE: I'm programming in Common Lisp or in LOOP-MACRO?
(defun make-prefix-table (pattern length)
"Get the shift prefix array table to use on KMP
algorithm. This value is used to shift string comparison
on the next evaluation after a mismatch"
@ryukinix
ryukinix / pygame-guide.md
Last active October 27, 2024 02:05
A mini-guide for introduction to Python + Pygame (PT-BR)

- * - My guide for Pygame Learning - * -

The 2nd Law of Universe

Comment: Sobreviva a luta com o inglês, resista, bata de frente e dê um jeito de ler — nem que tenha que usar o google translator (arrck!). Estou tentando compartilhar o máximo de coisas na nossa língua nativa... mas você, caro pythoneiro, sabe como é, não é? O inglês americano é língua padrão pra desenvolvimento de código, documentação e outras maravilhas do mundo da computação. Dê um jeito no seu inglês! — eu preciso dar um jeito no meu.

Dependency

Comment: Você precisa das dependências do Pygame, inclusive ele, no seu ambiente de desenvolvimento. Pra instalar pode usar pip, apt-get, pacman, yum ou qualquer que seja o gerenciador de pacotes que você usa. Ou você pode baixar o source e instalar por si mesmo (_hard-inst

@ryukinix
ryukinix / lock.sh
Last active March 24, 2023 13:46
How lock your system before suspend with openrc init via elogind using slock
#!/bin/sh
#
# /lib/elogind/system-sleep/lock.sh
# Lock before suspend integration with elogind
username=lerax
userhome=/home/$username
export XAUTHORITY="$userhome/.Xauthority"
export DISPLAY=":0.0"
@ryukinix
ryukinix / test.lisp
Created December 2, 2022 20:21
paper scissors rock written in loop
;; Then, a winner for that round is selected: Rock defeats Scissors,
;; Scissors defeats Paper, and Paper defeats Rock. If both players
;; choose the same shape, the round instead ends in a draw.
(defun winner (a b)
(loop with hands = (cons a b)
and rules = '(((paper . scissors) second)
((paper . rock) first)
((rock . paper) second)
((rock . scissors) first)
@ryukinix
ryukinix / info.txt
Created October 30, 2022 15:40
doom info debug
generated Oct 30, 2022 12:40:10
system "Artix Linux" Linux 5.15.74-1-lts x86_64
emacs 28.2 ~/.emacs.d.doomemacs/
doom 3.0.0-pre PROFILE=_@0 HEAD -> master, origin/master,
origin/HEAD 3a3489449 2022-10-29 21:57:51 +0200 ~/.doom.d/
shell /usr/bin/zsh
features ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS
HARFBUZZ JPEG JSON LCMS2 LIBOTF LIBXML2 M17N_FLT MODULES
NATIVE_COMP NOTIFY INOTIFY PDUMPER PNG RSVG SECCOMP SOUND
THREADS TIFF TOOLKIT_SCROLL_BARS X11 XDBE XIM XPM GTK3 ZLIB
@ryukinix
ryukinix / crispim-algorithm.py
Last active May 21, 2022 19:02
Algoritmo de sumarização automática de textos feito originalmente por Juca Crispim; seu artigo abordando esse método simplista inspirado no TextRank está no link anexado ao código.
#!/usr/bin/env python
#
# Python Script
#
# Copyright © Juca Crispim
#
# original source: https://goo.gl/NhfKET
import math
import nltk
@ryukinix
ryukinix / dateparser_lark.py
Last active February 4, 2022 15:35
An EBNF grammar based in the Lark Parser designed to parse multivariate date formats. (PT_BR)
#!/usr/bin/env python3
# coding: utf-8
#
# Copyright © Neoway Business Solutions
#
# @project: Diário Oficial
# @author: Manoel Vilela
#
"""