Skip to content

Instantly share code, notes, and snippets.

View gurgelrenan's full-sized avatar
:octocat:

Renan Gurgel gurgelrenan

:octocat:
View GitHub Profile
@thatrubylove
thatrubylove / 6.rb
Last active December 29, 2015 07:29
Solution for problem #6 @ http://projecteuler.net/problem=6
sum = ->(num_list) { num_list.reduce(:+) }
square = ->(number ) { number * number }
squares = ->(num_list) { num_list.map {|num| square.(num) } }
sum_squares = ->(num_list) { sum.(squares.(num_list)) }
square_sum = ->(num_list) { square.(sum.(num_list)) }
gem 'minitest'
require 'minitest/autorun'
describe "sum_squares" do
@everaldo
everaldo / municipios.yml
Created April 22, 2014 13:48
Lista de UFs e Municípios, segundo IBGE 2013 (5570 municípios)
---
- :cod_uf: '52'
:uf: Goiás
:city_id: '00050'
:city: Abadia de Goiás
:sigla_uf: GO
:city_code: '5200050'
- :cod_uf: '31'
:uf: Minas Gerais
:city_id: '00104'
@vitormalencar
vitormalencar / teste_agendakids.md
Last active August 7, 2017 23:01
Teste Front-End Agendakids

Bloco de notas Github

Sobre o teste

A meta é criarmos uma página simples, que consuma a API do GitHub e nos deixe criar anotações para cada perfil que escolhermos.

A aplicação deve ter um campo de busca onde será inserido o username, e ao pesquisar, o app deve mostrar o perfil completo do usuário com sua lista de repositórios.

O app também deve permitir que o usuário possa listar, adicionar, editar e remover notas (comentários) para cada usuário listado, utilizando a API do Firebase para armazenamento em realtime.

Algumas Imagens para REFERÊNCIA (apenas):

require 'omniauth-oauth2'
# this OmniAuth-Strategy uses the Keyrock Identity Management
# see http://catalogue.fiware.org/enablers/identity-management-keyrock
# The server url is from the public FIWARE Lab instance.
module OmniAuth
module Strategies
class FilabStrategy < OmniAuth::Strategies::OAuth2
option :name, "filab"
option :client_options, {
@jkotchoff
jkotchoff / aws_sns_push_notification.rb
Last active February 24, 2021 00:57
Sends a push notifications to an iOS and an Android device from Amazon SNS V2
require 'rubygems'
require 'aws-sdk'
# This code snippet sends a push notification to a device using the Amazon SNS service.
#
# It is using the preview V2 amazon gem as per:
# https://aws.amazon.com/sdk-for-ruby/
#
# This was installed using:
# $ gem install aws-sdk --pre
@giannisp
giannisp / gist:b53a76047b07751ed3ade3c1db1d2c51
Created November 18, 2016 05:50
Upgrade PostgreSQL 9.5.5 to 9.6.1 using Homebrew (macOS)
After automatically updating Postgres to 9.6.1 via Homebrew, the pg_ctl start command didn't work.
The error was something like "database files are incompatible with server".
Database files have to be updated before starting the server, here are the steps that had to be followed:
# need to have both 9.6.1 and latest 9.5.x installed, and keep 9.6.1 as default
brew unlink postgresql
brew install postgresql95
brew unlink postgresql95
brew link postgresql
@brentertz
brentertz / rvm2rbenv.txt
Created November 21, 2011 23:00
Switch from RVM to RBENV
## Prepare ###################################################################
# Remove RVM
rvm implode
# Ensure your homebrew is working properly and up to date
brew doctor
brew update
## Install ###################################################################
@SabretWoW
SabretWoW / 42-things.md
Last active May 13, 2022 07:32 — forked from xdite/42-things.md
42 Sweet, sweet things Rails (and Ruby) can do. Wonderful reference.
@alex-zige
alex-zige / gist:5795358
Last active June 8, 2023 07:49
Rails Rspec API Testing Notes

Rails Rspec APIs Testing Notes

Folders Structure

  spec
  |--- apis #do not put into controllers folder. 
        |--- your_api_test_spec.rb  
  |--- controllers
  |--- models
  |--- factories
 |--- views