Skip to content

Instantly share code, notes, and snippets.

View airvzxf's full-sized avatar

Israel Roldan airvzxf

View GitHub Profile
@airvzxf
airvzxf / Ejercicio-001.rb
Last active December 16, 2015 15:18
Codecery :: | Beautiful asterisk in console mode | Fahrenheit to Celsius | Celsius to Fahrenheit |
##### Fahrenheit to Celsius
def convert(f)
c = ((f.to_i-32)*(5.0/9.0))
c = (c * 10).round * 0.1
end
puts "Convert Fahrenheit to Celsius."
print "Input the Fahrenheit: "
f = gets
@airvzxf
airvzxf / Exercise-002.rb
Created April 25, 2013 17:10
Codecery :: Exercise 002
##### Adds
puts "Adds n + (n-x)."
#print "Input an integer number: "
#n = gets
n = 5
(n).downto(0) do |a|
x = n-a
break if a < x
puts "#{a} + #{x} = #{a+x}"
@airvzxf
airvzxf / Exercise-003.rb
Created April 26, 2013 16:40
Codecery :: Exercise 003
##### Perfect Number
puts "This is the perfect number."
x = 30
(x).times do |n|
(n).downto(1) do |a|
#puts "a: #{a}"
d = 0
(1..a).each do |b|
if a % b == 0
@airvzxf
airvzxf / Exercise-004.rb
Last active December 16, 2015 19:08
Codecery :: Exercise 004
require 'test/unit'
extend Test::Unit::Assertions
FIRST_TEN = ["zero ", "one ", "two ", "three ", "four ", "five ", "six ", "seven ", "eight ", "nine "]
SECOND_TEN = ["ten ", "eleven ", "twelve ", "thirteen ", "fourteen ", "fifteen ", "sixteen ", "seventeen ", "eighteen ", "nineteen "]
OTHER_TENS = ["", "", "twenty ", "thirty ", "forty ", "fifty ", "sixty ", "seventy ", "eighty ", "ninety "]
HUNDRED = "hundred "
def number2text(number)
@airvzxf
airvzxf / inject-python-functions.pl
Created December 6, 2020 04:51
Perl: Inject inside of every Python function (`def`) a print statement on this way you can see what is executing during runtime.
#!/usr/bin/perl
#
# Strict and warnings are recommended.
use strict;
use warnings;
use Cwd;
use File::Find;
my $base_path = Cwd::cwd . '/';
my $path = $base_path . 'pwndbg/';
@airvzxf
airvzxf / faster_mirrorlist_pacman.sh
Last active March 26, 2022 15:58
Update the mirrorlist of Pacman adding the faster server available.
#!/bin/bash +xv
echo -e "~~~~~~~~~~~ START THE SERVICE TO RUN REFLECTOR ~~~~~~~~~~~"
echo ""
while [ 1 ]
do
if ping -c 1 google.com >> /dev/null 2>&1
then
echo -e "~~~~~~~~~~~ RUN THE REFLECTOR PACKAGE ~~~~~~~~~~~"
@airvzxf
airvzxf / github-actions-delete.bash
Created June 5, 2021 03:49
GitHub API -> Delete Runs from Workflows (Actions)
#!/usr/bin/env bash
USERNAME="my_user"
REPOSITORY="the_repo"
TOKEN="ghp_github_token permissions: repo, workflow"
WORKFLOW_RUNS=$(
curl \
-H "Accept: application/vnd.github.v3+json" \
--silent \
@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 / 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
@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
"""