Skip to content

Instantly share code, notes, and snippets.

Avatar

Cibernómadas Cibernomadas

View GitHub Profile
View gist:599ac5ce1ac731fac4d103ca45f03874
$GOPATH
/src
/github.com/user/repo
/mypkg
mysrc1.go
mysrc2.go
/cmd/mycmd
main.go
/bin
mycmd
View main.go
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
SSH config file
View conf
Host github
HostName github.com
User git
@Cibernomadas
Cibernomadas / conf
Created May 20, 2018
SSH config file
View conf
Host Cibernomadas
HostName xx.xx.xx.xx
Port 1234
User juanito
View index.html
<!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>
View flask.py
from flask import Flask
app = Flask(__name__)
@app.route('/')
def hello():
return 'Hello, World!'
View gist:78f4528902f5a90c1e7428f129aec266
$> 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)
View flask.py
from flask import Flask
app = Flask(__name__)
@app.route('/')
def indexFn():
return '''
<html>
<head>
<title>Calculadora</title>
View main.go
if update.Message.IsCommand() {
// Comprobar comando suma
// Comprobar comando resta
// Comprobar comando multiplicación
// Comprobar comando división
// Comprobar comando start
}
View main.go
func normalizaCadena(arg string) []string {
re := regexp.MustCompile(" +")
aux := re.ReplaceAllString(arg, " ")
return strings.Split(aux, " ")
}
You can’t perform that action at this time.