Skip to content

Instantly share code, notes, and snippets.

View lukin0110's full-sized avatar
💭
Busy setting my status

Maarten Huijsmans lukin0110

💭
Busy setting my status
View GitHub Profile
"""
Non blocking example:
1. Browse to `localhost:8000/sleep1`
2. Browse to `localhost:8000/`
You'll observe that the first call will take 5 seconds and the second call will be executed immediately.
Blocking example:
1. Browse to `localhost:8000/sleep2`
2. Browse to `localhost:8000/`
@lukin0110
lukin0110 / number.sh
Created January 10, 2019 00:12
Number of files in a directory
find . -type f | wc -l
find . | grep -E "(__pycache__|\.pyc|\.pyo$)" | xargs rm -rf
@lukin0110
lukin0110 / Dockerfile
Created March 30, 2017 08:48
Docker + Python 3 + OpenCV 3.2
FROM python:3.6.1
ENV DEBIAN_FRONTEND=noninteractive
WORKDIR /
# Install some essential build tools
RUN apt-get update \
&& apt-get -y install wget unzip \
build-essential cmake git pkg-config libatlas-base-dev gfortran \
libjasper-dev libgtk2.0-dev libavcodec-dev libavformat-dev \
@lukin0110
lukin0110 / docker-protobuf.sh
Created March 15, 2017 11:10
Docker snippet to install a certain version of Google's protocol buffers
# Install protocol buffers
# https://github.com/google/protobuf/tree/master/src
ENV PROTOBUF_VERSION=3.1.0
RUN apt-get --yes install autoconf automake libtool curl make g++ unzip
RUN wget https://github.com/google/protobuf/archive/v${PROTOBUF_VERSION}.zip \
&& unzip v${PROTOBUF_VERSION}.zip \
&& cd protobuf-${PROTOBUF_VERSION} \
&& ./autogen.sh \
&& ./configure \
&& make \
#!/bin/bash
if [ -f VERSION ]; then
BASE_STRING=`cat VERSION`
BASE_LIST=(`echo $BASE_STRING | tr '.' ' '`)
V_MAJOR=${BASE_LIST[0]}
V_MINOR=${BASE_LIST[1]}
V_PATCH=${BASE_LIST[2]}
echo "Current version : $BASE_STRING"
# V_MINOR=$((V_MINOR + 1))

Keybase proof

I hereby claim:

  • I am lukin0110 on github.
  • I am lukin0110 (https://keybase.io/lukin0110) on keybase.
  • I have a public key ASD1-KJaIm7rbz_FfRUmv0u1st5HVhGdPwCAaJXLufZLfgo

To claim this, I am signing this object:

When you use Docker for development you're not relying on virtualenv anymore. PyCharm relies on virtualenv for code completion. Therefore we still need to create a virtualenv for each Python project.

The virtualenv is only used for PyCharm, handy for code completion. Installation guide. The actual development happens in a Docker container.

$ brew install postgresql
$ brew install pyenv
$ pyenv install 3.4.1
# TriFlux Alpine Development Container
#
# Alpine Node Party: https://github.com/mhart/alpine-node
#
# VERSION 0.0.1
FROM mhart/alpine-node:5
ENV PORT 5001
ENV NODE_ENV development
{
"Records": [
{
"eventVersion": "2.0",
"eventSource": "aws:s3",
"awsRegion": "eu-west-1",
"eventTime": "2016-01-29T08:52:29.697Z",
"eventName": "ObjectCreated:Put",
"userIdentity": {
"principalId": "AWS:AIDAJGX67TKJQHWYJVL2O"