Skip to content

Instantly share code, notes, and snippets.

View rhpaiva's full-sized avatar

Rodrigo Paiva rhpaiva

  • Berlin, Germany
View GitHub Profile

Making Kubernetes How We Build Things

This talk is all live demos of tools developers can use in their inner-loop, at development time to be more productive with containers.

Start Easier

Docker Compose captures the build arguments and run arguments so we can focus on our coding.

@rhpaiva
rhpaiva / PHP8-amqp-build.Dockerfile
Last active September 25, 2021 18:59
Dockerfile for PHP 8 with amqp extension built from source while the library doesn't get updated. Based on the thread: https://github.com/php-amqp/php-amqp/issues/386
FROM php:8.0-fpm-alpine as linux_dependencies
# Install modules
RUN apk upgrade --update && apk --no-cache add \
$PHPIZE_DEPS \
freetype-dev \
libjpeg-turbo-dev \
libpng-dev \
icu-dev \
libpq \
@rhpaiva
rhpaiva / ApiJsonDeserializationVisitor.php
Last active January 3, 2019 11:39
JMS Serializer Visitor Service that does not perform type casting on deserialization.
<?php
declare(strict_types = 1);
namespace Api\Request;
use Api\Request\Exception\DeserializationException;
use JMS\Serializer\Context;
use JMS\Serializer\Exception\RuntimeException;
use JMS\Serializer\GenericDeserializationVisitor;
@rhpaiva
rhpaiva / .vimrc
Created June 1, 2015 00:29
vimrc
colorscheme slate
set nocompatible "This fixes the problem where arrow keys do not function properly on some systems.
syntax on "Enables syntax highlighting for programming languages
set mouse=a "Allows you to click around the text editor with your mouse to move the cursor
set showmatch "Highlights matching brackets in programming languages
set autoindent "If you're indented, new lines will also be indented
set smartindent "Automatically indents lines after opening a bracket in programming languages
set backspace=2 "This makes the backspace key function like it does in other programs.
set tabstop=4 "How much space Vim gives to a tab
set number "Enables line numbering
@rhpaiva
rhpaiva / .gitconfig
Created June 1, 2015 00:28
git config
[user]
email = :)@gmail.com
name = Rodrigo Paiva
[alias]
co = checkout
cm = commit
st = status
br = branch
#hist = log --pretty=format:\"%h %ad | %s%d [%an]\" --graph --date=short
@rhpaiva
rhpaiva / setup-new-computer.sh
Last active August 29, 2015 14:21
Steps to setup a new computer for web development based on ubuntu and docker
#!/usr/bin/env bash
# =================================================================
# Steps to setup a new computer for web development based on ubuntu
# =================================================================
# vars
downloads_dir=~/Downloads
chrome_file='google-chrome-stable_current_amd64.deb'
skype_file='skype-ubuntu-precise_4.3.0.37-1_i386.deb'
@rhpaiva
rhpaiva / .bash_aliases
Last active August 29, 2015 14:21
Handful set of aliases
## ================= ##
## Personal aliases ##
## ================= ##
hosts="/etc/hosts"
# shortcuts for bash edition
alias bashreload='source ~/.bashrc'
alias bashedit='vim ~/.bashrc'
#http://stackoverflow.com/questions/5870188/does-flask-support-regular-expressions-in-its-url-routing
#Even though Armin beat me to the punch with an accepted answer I thought I'd show an abbreviated example of how I implemented a regex matcher in Flask just in case anyone wants a working example of how this could be done.
from flask import Flask
from werkzeug.routing import BaseConverter
app = Flask(__name__)
class RegexConverter(BaseConverter):
def __init__(self, url_map, *items):
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
make install # ok, fine, this step probably takes more than 30 seconds...
curl https://npmjs.org/install.sh | sh