Skip to content

Instantly share code, notes, and snippets.

View Cibernomadas's full-sized avatar

Cibernómadas Cibernomadas

View GitHub Profile
$GOPATH
/src
/github.com/user/repo
/mypkg
mysrc1.go
mysrc2.go
/cmd/mycmd
main.go
/bin
mycmd
package main
import (
"log"
"gopkg.in/telegram-bot-api.v4"
)
func main() {
bot, err := tgbotapi.NewBotAPI("** bot token **")
@Cibernomadas
Cibernomadas / conf
Created May 20, 2018 20:50
SSH config file
Host github
HostName github.com
User git
@Cibernomadas
Cibernomadas / conf
Created May 20, 2018 20:52
SSH config file
Host Cibernomadas
HostName xx.xx.xx.xx
Port 1234
User juanito
<!DOCTYPE html>
<html>
<head>
<title>Cibernómadas</title>
</head>
<body>
<h1>Blog de tecnología</h1>
<p>Esta es nuestra web:
<a href="http://www.cibernomadas.es/">Cibernómadas</a>
</p>
from flask import Flask
app = Flask(__name__)
@app.route('/')
def hello():
return 'Hello, World!'
$> FLASK_APP=hello.py flask run
* Serving Flask app "hello.py"
* Environment: production
WARNING: Do not use the development server in a production environment.
Use a production WSGI server instead.
* Debug mode: off
* Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
from flask import Flask
app = Flask(__name__)
@app.route('/')
def indexFn():
return '''
<html>
<head>
<title>Calculadora</title>
if update.Message.IsCommand() {
// Comprobar comando suma
// Comprobar comando resta
// Comprobar comando multiplicación
// Comprobar comando división
// Comprobar comando start
}
func normalizaCadena(arg string) []string {
re := regexp.MustCompile(" +")
aux := re.ReplaceAllString(arg, " ")
return strings.Split(aux, " ")
}