Skip to content

Instantly share code, notes, and snippets.

View sdemingo's full-sized avatar

Sergio de Mingo sdemingo

View GitHub Profile
# Add Docker's official GPG key:
sudo apt-get update
sudo apt-get install ca-certificates curl
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/debian/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc
# Add the repository to Apt sources:
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/debian \
@sdemingo
sdemingo / login.html
Last active February 24, 2016 18:13
Basic users authentication over TLS in Go
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Login</title>
<meta http-equiv="content-type" content="text/html;charset=utf-8" />
</head>
<body>
<form method="POST" action="/login">
<label>Login:</label><input type="text" name="username" />
@sdemingo
sdemingo / rss2org.go
Last active August 29, 2015 14:13
How convert a RSS source to org-mode calendar file
package main
import (
"time"
"bytes"
"encoding/xml"
"os"
"fmt"
"net/http"
@sdemingo
sdemingo / ast_sample.go
Created June 3, 2013 06:42
An example of use of go/ast and go/parser. It shows to how evaluate an arithmetic expression and to build the prefix notation.
package main
import (
"go/ast"
"go/parser"
"go/token"
"fmt"
"errors"
"strconv"
"io/ioutil"