Skip to content

Instantly share code, notes, and snippets.

View arruda's full-sized avatar

Felipe Arruda Pontes arruda

View GitHub Profile

Keybase proof

I hereby claim:

  • I am arruda on github.
  • I am felipearruda (https://keybase.io/felipearruda) on keybase.
  • I have a public key whose fingerprint is 3254 CD16 FC1F 3F85 5FC8 05A9 A17A E420 0913 706D

To claim this, I am signing this object:

@arruda
arruda / relax.js
Created March 30, 2018 14:50 — forked from TheNicholasNick/relax.js
CouchDB Map/Reduce Example
// Data
[
{"_id":"pvg:IHC09A","_rev":"1-3881006720","nvic":"IHC09A","family":"159","couchrest-type":"GRD::Pvg","make":"ALFA ROMEO"},
{"_id":"pvg:IJU09A","_rev":"1-243536901","nvic":"IJU09A","family":"147","couchrest-type":"GRD::Pvg","make":"ALFA ROMEO"},
{"_id":"pvg:IJV09A","_rev":"1-3794903136","nvic":"IJV09A","family":"147","couchrest-type":"GRD::Pvg","make":"ALFA ROMEO"},
{"_id":"pvg:IJY09A","_rev":"1-1301614913","nvic":"IJY09A","family":"147","couchrest-type":"GRD::Pvg","make":"ALFA ROMEO"},
{"_id":"pvg:J3X09A","_rev":"1-1398113861","nvic":"J3X09A","family":"V8","couchrest-type":"GRD::Pvg","make":"ASTON MARTIN"}
]
// Map
@arruda
arruda / fig.yml
Created January 26, 2015 16:21
Fig with PG
db:
image: postgres:9.3
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
volumes:
- /var/lib/postgresql/data
ports:
- "5432:5432"
@arruda
arruda / best_practices.md
Last active August 29, 2015 13:57
Django Python Web Framework Best Practices

Read this before you post something:

  1. The group is not here to do your homework.

Don't expect others to do everything for you, be it your homework or your job. So try doing something first!

  1. Share code nicely.

If you want to share a code, or need help with it, then put it in https://gist.github.com or something similar. This way others can have a better understanding of what your code is about.

void InserctionSort(int n, int vetor[]){
int j,i, chave;
for(j = 1; j < n; j++){
chave = vetor[j];
i = j - 1;
while(i >= 0 && vetor[i] > chave){
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': '/home/lanchinho/blablabla/tutorial/db.sqlite' ,
'USER': '',
'PASSWORD': '',
'HOST': '',
'PORT': '',
}
}
@arruda
arruda / helloworld.rst
Created May 14, 2013 16:50
Hovercraft! Examples.
title:Hello World!

This is a simple Hello world example for hovercraft!


This is the First Slide:

Some text here in this slide...

@arruda
arruda / test_com_request_context.py
Created March 26, 2013 18:24
Usar RequestContext no Lugar de Context em testes onde for necessário renderizar um template manualmente. Se não usar o RequestContext ele ignora alguns, senão todos os TEMPLATE_CONTEXT_PROCESSORS, e não renderiza como deveria ou dependendo da template em questão, ele nem roda...
# -*- coding: utf-8 -*-
from lxml import html as lhtml
from django.template import Context, Template, RequestContext
from django.test import RequestFactory
factory = RequestFactory()
class TestTemplate(AlgumTestCase):
django-admin.py startproject --template=https://github.com/githubuser/dj_project_templates/blob/master/project_template.tar --extension="md,py" myproject
@arruda
arruda / awk_primo.awk
Created December 6, 2012 21:45
AOU exercicio awk
{num=$1
for (div = 2; div*div <= num; div++)
if (num % div == 0)
break
if (num % div == 0)
printf "%d nao eh primo\n", num
else
printf "%d eh primo\n",num}