Skip to content

Instantly share code, notes, and snippets.

View AdryDev92's full-sized avatar
🎯
Focusing

AdryDev92 AdryDev92

🎯
Focusing
  • Spain
  • Seville
View GitHub Profile
@AdryDev92
AdryDev92 / basic_calculator.rb
Created March 27, 2020 20:21
Basic calculator in ruby with four operations. If you press "N" after an operation, the app ends.
puts "======================"
puts "| CALCULADORA BÁSICA |"
puts "| EN RUBY |"
puts "======================"
ops = ["1.suma","2.resta","3.multiplicación","4.división"]
begin
puts "\n¿Qué operación deseas realizar?"
@AdryDev92
AdryDev92 / simple_buy_list.html
Created October 30, 2019 01:14
A simple buy list with add/delete buttons
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Lista de la compra</title>
</head>
<body>
<script type="text/javascript">
@AdryDev92
AdryDev92 / request.php
Last active March 22, 2019 10:58
file request to connect with telegram bot
<?php
//api token bot
$botToken = " ";
$website = "https://api.telegram.org/bot".$botToken;
$update = file_get_contents('php://input');
$update = json_decode($update, TRUE);
@AdryDev92
AdryDev92 / create-file.sh
Created March 20, 2019 23:15
A simple script to create a file with a text of your choose in the location you want
#! /bin/zsh
#if you use bash, simply change /bin/zsh to /bin/bash
if [ "$1" = "-h" ]; then
echo "The correct way to use this script:
[arg1] = file name
./create-file [arg1]"
exit 0
@AdryDev92
AdryDev92 / folder-tree.sh
Last active October 27, 2019 06:40
A simple script to build a folder tree
#! /bin/zsh
#if you use bash, only change /bin/zsh to /bin/bash
echo "Write the folder name:"
read folder
mkdir -p $folder/{folder-a/{a1,a2,a3},folder-b/{b1,b2,b3},folder-c/{c1,c2,c3}}
@AdryDev92
AdryDev92 / auto-repo.sh
Last active October 27, 2019 08:42
Self building repo into github with direct connection
#! /bin/zsh
# if you use bash, change /bin/zsh to /bin/bash
if [ "$1" = "-h" ]; then
echo "To use correctly this script, execute:
[arg1 = folder name] [arg2 = repo/github/url]
@AdryDev92
AdryDev92 / coffeeMaker.java
Created February 28, 2019 06:39
Simple program using calls to functions in loops
import java.util.Scanner;
class CoffeeMaker {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n;
do {
System.out.println("What do you want to do?\n1. Drop coffee\n2.Recharge coffee maker\n0. Exit");
@AdryDev92
AdryDev92 / calculateArea.py
Last active September 8, 2018 03:57
Calculate area of a figure (square, rectangle, triangle)
a = float(input("input width: "))
b = float(input("input height: "))
def calculateArea(a,b):
area = a*b
return area
result = calculateArea(a,b)
print(result)
@AdryDev92
AdryDev92 / hypotenuse.py
Last active September 8, 2018 02:41
calculate hypotenuse
from math import sqrt
#input lenght of a and b
print("Input lengths of a and b sides of triangle:")
a = float(input("side a: "))
b = float(input("side b: "))
#calculate square root of a and b
c = sqrt(a**2 + b**2)
@AdryDev92
AdryDev92 / bf_dictry.py
Created September 8, 2018 00:50
Simple brute force dictionary made in python3
import os
# Se introduce la ruta para la creacion del diccionario por teclado
route = input("Introduce la ruta donde se creará el diccionario:")
# la funcion open acepta la ruta donde se va a crear el archivo
# y la W otorga permisos de escritura
file = open(route+"/dictionary.txt", "w")
# la funcion write rellena el contenido del archivo dictinary.txt