Skip to content

Instantly share code, notes, and snippets.

View filipelenfers's full-sized avatar

Filipe Pais Lenfers filipelenfers

View GitHub Profile
@filipelenfers
filipelenfers / README.md
Created November 19, 2019 17:00 — forked from davideicardi/README.md
Write and read Avro records from bytes array

Avro serialization

There are 4 possible serialization format when using avro:

@filipelenfers
filipelenfers / dict_to_dynamodb_item.py
Last active October 10, 2019 19:10 — forked from JamieCressey/dict_to_dynamodb_item.py
Coverts a standard Python3 dictionary to a Boto3 DynamoDB item
def dict_to_item(raw:dict):
return {
key: _dict_to_item_recurse(value)
for key, value in raw.items()
}
def _dict_to_item_recurse(raw):
if isinstance(raw, dict):
return {
@filipelenfers
filipelenfers / redis-server
Created March 11, 2015 18:20 — forked from tahajahangir/redis-server
init.d file for redis-server
#!/bin/sh
#
# redis - this script starts and stops the redis-server daemon
#
# chkconfig: - 85 15
# description: Redis is a persistent key-value database
# processname: redis-server
# config: /etc/redis/redis.conf
# config: /etc/sysconfig/redis
# pidfile: /var/run/redis/redis.pid
1033edge.com
11mail.com
123.com
123box.net
123india.com
123mail.cl
123qwe.co.uk
150ml.com
15meg4free.com
163.com
#!/bin/bash
# must run as root!!!
RUBY_VERSION=1.9
RUBY_PATCH=1.9.3-p429
#RUBY_PATCH=1.9.3-p286
#RUBY_PATCH=1.9.3-p194
aptitude install -y build-essential libssl-dev libreadline-dev zlib1g-dev libyaml-dev libffi-dev
@filipelenfers
filipelenfers / rest.scala
Created June 14, 2013 16:05 — forked from stonegao/rest.scala
Rest using Finagle
class Respond extends Service[Request, Response] with Logger {
def apply(request: Request) = {
try {
request.method -> Path(request.path) match {
case GET -> Root / "todos" => Future.value {
val data = Todos.allAsJson
debug("data: %s" format data)
Responses.json(data, acceptsGzip(request))
}
case GET -> Root / "todos" / id => Future.value {