Skip to content

Instantly share code, notes, and snippets.

Avatar

Felipe Arruda Pontes arruda

View GitHub Profile
View keybase.md

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 Mar 30, 2018 — forked from SoreGums/relax.js
CouchDB Map/Reduce Example
View relax.js
// 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 Jan 26, 2015
Fig with PG
View fig.yml
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 Aug 29, 2015
Django Python Web Framework Best Practices
View best_practices.md

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.

View insertionSort.cpp
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){
View exemplo.py
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
Hovercraft! Examples.
View helloworld.rst
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 Mar 26, 2013
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...
View test_com_request_context.py
# -*- 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):
View http_cmd.sh
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 Dec 6, 2012
AOU exercicio awk
View awk_primo.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}