The never-ending REST API design debate by Guillaume Laforge

February 11, 2019 Leave a comment

What should a good REST API look like? Should you use verbs or nouns in your resource paths? How do you handle versioning of APIs? How to deal with partial responses and pagination? Which status codes should I make use of? What about sorting, filtering, and searching? Have you thought about content negotiation, cross-domain access, hypermedia, and authentication?

Guillaume will got through all these topics, offering advice on the best approaches to those questions, and opening up the debate on the various options available, so as to make your Web API at REST, as clean and elegant as possible.

Advertisements
Categories: Interesting Tags: ,

YOW! West 2015 Damian Conway – Everything You Know About Regexes Is Wrong #YOWWest

February 4, 2019 Leave a comment

For most programmers, regular expressions are a riddle wrapped in a mystery inside an enigma shrouded in line-noise. So most sensible programmers either don’t use them at all (and are thereby forced to reinvent worse wheels…badly), or else they fall back on an “evolutionary programming” approach: find an existing regex that looks like it might do, then randomly permute its “genome” over and over again until it appears to work.

In this talk, we’ll go back to basics and discover that regexes mostly aren’t what you think they are, mostly don’t work the way you were taught they did, and mostly shouldn’t be created the way everyone tells you to.

More usefully, we’ll also talk about what regexes really are, how they actually work, and see how normal programmers can make use of their existing software development skills to construct correct and efficient regexes…without selling their souls or losing their minds.

Damian Conway holds a B.Sc. and a Ph.D. in Computer Science.

A widely sought-after speaker and trainer, he is also the author of numerous well-known Open Source software libraries and developer tools, as well as several books and series of articles on programming. Between 2001 and 2010 was Adjunct Associate Professor with the Faculty of Information Technology, Monash University, Australia.

Other technical areas in which he has worked and published include: developer education, presentation skills, programming language design, language paradigms, software engineering, testing and debugging, documentation systems, natural language generation, synthetic language generation, emergent systems, image morphing, human-computer interaction, geometric modelling, the psychophysics of perception, nanoscale simulation, and parsing techniques.

Categories: Interesting Tags:

Useful GPG commands

February 3, 2019 Leave a comment
Categories: Interesting

Vim as a Python IDE

February 1, 2019 Leave a comment

VIM as a Python IDE

This project aims to use Vim as a powerful and complete Python IDE. In order to do that, we curated a list of awesome plugins available in the community and provided an automatic installation procedure for this set.

https://rapphil.github.io/vim-python-ide/

Source:
https://www.pythonweekly.com/

Categories: Interesting, python, vim Tags:

Developing RESTful APIs with Python and Flask

January 30, 2019 Leave a comment

TL;DR: Throughout this article, we are going to use Flask and Python to develop a RESTful API. We will start by creating an endpoint that returns static data (dictionaries). After, we are going to create a class with two specializations and a few endpoints to insert and retrieve instances of these classes. Finally, will take a look on how to run the API on a Docker container. The final code developed throughout this article can be found in this GitHub repository. I hope you enjoy!

https://auth0.com/blog/developing-restful-apis-with-python-and-flask/

Categories: Interesting

Reading environment variables from a file into a Makefile

January 30, 2019 Leave a comment

Problem:
You have a bunch of environment variables that are explicitly set at the beginning of a Makefile. These variables are then used in various recipes in the Makefile. The issue was that when a developer runs the Makefile, these environment variables overwrite their local settings.

Solution:
One option is to move the environment variables out of the Makefile and use include to add them back. So the developer can use whatever values they have in their current setup as long as the names are the same.

# Makefile

foo=FOO1
bar=BAR1
baz=BAZ1

export foo
export bar
export baz

.PHONY:  target1 target2 target3

target1:
    @echo $(foo)

target2:
    @echo $(bar)

target3:
    @echo $(baz)

After splitting it up.

# .env file
foo=FOO1
bar=BAR1
baz=BAZ1

export foo
export bar
export baz
# Makefile
include .env

.PHONY:  target1 target2 target3

target1:
    @echo $(foo)

target2:
    @echo $(bar)

target3:
    @echo $(baz)

The problem with this approach is that the .env file needs to exist everywhere it will run. If you have some CI/CD setup that may not be the case. Instead have the Makefile as below and have the ENV vars set up the usual way you would in your CI/CD setup. On the local machine one can simply run $ source .env before running $ make to get things to work.

# Makefile
.PHONY:  target1 target2 target3

target1:
    @echo $(foo)

target2:
    @echo $(bar)

target3:
    @echo $(baz)

Source:
https://stackoverflow.com/questions/39005789/reading-makefile-variables-from-bash-script

Categories: bash Tags:

How I Built A Python Web Framework And Became An Open Source Maintainer

January 22, 2019 Leave a comment

Inspirational thoughts and tips on starting and managing an open source project, based on my experience building Bocadillo, an asynchronous Python web framework.

https://blog.florimondmanca.com/how-i-built-a-web-framework-and-became-an-open-source-maintainer

Source:
https://www.pythonweekly.com/

Categories: Interesting