Skip to content

Instantly share code, notes, and snippets.


Sebastian Karlsson sebbekarlsson

Block or report user

Report or block sebbekarlsson

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
sebbekarlsson /
Created Oct 11, 2018
Asking questions in bash
function ask() {
read -p "$1" -n 1 -r
if [[ $REPLY =~ ^[Yy]$ ]]
sebbekarlsson / cpp_multiple_types.cpp
Last active Sep 18, 2018
C++ function that returns multiple types and multiple types as argument
View cpp_multiple_types.cpp
#include <iostream>
template <typename T>
T perform_operation(const T& left, std::string op, const T& right) {
if (op == "+")
return left + right;
if (op == "-")
return left - right;
sebbekarlsson /
Last active Jul 13, 2018
Creating a simple web application in Python and running it under Nginx

Python web application with Nginx

Let us create a simple API in Python and serving it using Nginx.

In this example we will use Debian 9 as a distro for the server.

The code

Alright, let's write some code.
We will create an API that will serve an array of fruits.

Let's create a file:

You can’t perform that action at this time.