Skip to content

Instantly share code, notes, and snippets.

View RomuloOliveira's full-sized avatar

Rômulo Oliveira RomuloOliveira

View GitHub Profile
@eduardompinto
eduardompinto / Readme.md
Last active August 17, 2016 18:06
Criando uma cara para contar relações de quem fez X, também fez X

Relacionamento de quem fez X, também fez X

O objetivo aqui é pegar uma entrada composta por um csv com: produto, sessão. E considerando que a ação X foi aplicada a ele criar um cara que pega as relações por sessão.

Exemplo de entrada:

1231312124,cb808cb9-3bfd-4c0c-ad20-2e181b9b3a93
1231212124,cb808cb9-3bfd-4c0c-ad20-2e181b9b3a93
1231112124,cb808cb9-3bfd-4c0c-ad20-2e181b9b3a93
1231762124,cb808cb9-3bfd-4c0c-ad20-2e181b9b3a93
@nolanlawson
nolanlawson / protips.js
Last active February 4, 2024 18:06
Promise protips - stuff I wish I had known when I started with Promises
// Promise.all is good for executing many promises at once
Promise.all([
promise1,
promise2
]);
// Promise.resolve is good for wrapping synchronous code
Promise.resolve().then(function () {
if (somethingIsNotRight()) {
throw new Error("I will be rejected asynchronously!");
@drgarcia1986
drgarcia1986 / bottle_hello.py
Last active September 30, 2022 16:19
Python HelloWorld (WebFrameworks) Collection
# -*- coding: utf-8 -*-
from bottle import route, run
@route('/')
def index():
return '<h1>Hello World/h1>'
run(host='localhost', port=8000)
@jlafon
jlafon / dynamodb.md
Created December 3, 2014 05:03
An Introduction to Amazon's DynamoDB

An introduction to DynamoDB

DynamoDB is a powerful, fully managed, low latency, NoSQL database service provided by Amazon. DynamoDB allows you to pay for dedicated throughput, with predictable performance for "any level of request traffic". Scalability is handled for you, and data is replicated across multiple availability zones automatically. Amazon handles all of the pain points associated with managing a distributed datastore for you, including replication, load balancing, provisioning, and backups. All that is left is for you to take your data, and its access patterns, and make it work in the denormalized world of NoSQL.

Modeling your data

The single most important part of using DynamoDB begins before you ever put data into it: designing the table(s) and keys. Keys (Amazon calls them primary keys) can be composed of one attribute, called a hash key, or a compound key called the hash and range key. The key is used to uniquely identify an item in a table. The choice of the primary key is particularl