Skip to content

Instantly share code, notes, and snippets.

View vpershukov's full-sized avatar

vpershukov

  • Moscow
View GitHub Profile
@L2Banners
L2Banners / GoLang Random Number
Created May 18, 2018 15:35
GoLang Рандомное число в диапазоне чисел
package main
import (
"fmt"
"math/rand"
"time"
)
func random(min, max int) int {
rand.Seed(time.Now().Unix())
@miguelgrinberg
miguelgrinberg / rest-server.py
Last active July 30, 2025 09:09
The code from my article on building RESTful web services with Python and the Flask microframework. See the article here: http://blog.miguelgrinberg.com/post/designing-a-restful-api-with-python-and-flask
#!flask/bin/python
from flask import Flask, jsonify, abort, request, make_response, url_for
from flask_httpauth import HTTPBasicAuth
app = Flask(__name__, static_url_path = "")
auth = HTTPBasicAuth()
@auth.get_password
def get_password(username):
if username == 'miguel':