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
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?" |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>Lista de la compra</title> | |
</head> | |
<body> | |
<script type="text/javascript"> |
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
<?php | |
//api token bot | |
$botToken = " "; | |
$website = "https://api.telegram.org/bot".$botToken; | |
$update = file_get_contents('php://input'); | |
$update = json_decode($update, TRUE); |
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
#! /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 |
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
#! /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}} |
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
#! /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] | |
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
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"); |
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
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) |
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
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) |
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
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 |
NewerOlder