Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

AdryDev92 AdryDev92

🎯
Focusing
View GitHub Profile
@AdryDev92
AdryDev92 / basic_calculator.rb
Created Mar 27, 2020
Basic calculator in ruby with four operations. If you press "N" after an operation, the app ends.
View basic_calculator.rb
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 Oct 30, 2019
A simple buy list with add/delete buttons
View simple_buy_list.html
<!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 Mar 22, 2019
file request to connect with telegram bot
View request.php
<?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 Mar 20, 2019
A simple script to create a file with a text of your choose in the location you want
View create-file.sh
#! /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 Oct 27, 2019
A simple script to build a folder tree
View folder-tree.sh
#! /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 Oct 27, 2019
Self building repo into github with direct connection
View auto-repo.sh
#! /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 Feb 28, 2019
Simple program using calls to functions in loops
View coffeeMaker.java
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 Sep 8, 2018
Calculate area of a figure (square, rectangle, triangle)
View calculateArea.py
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 Sep 8, 2018
calculate hypotenuse
View hypotenuse.py
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 Sep 8, 2018
Simple brute force dictionary made in python3
View bf_dictry.py
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
You can’t perform that action at this time.