Skip to content

Instantly share code, notes, and snippets.

View viniciussbs's full-sized avatar

Vinícius Sales viniciussbs

  • Rio de Janeiro, Brasil
View GitHub Profile
@helfer
helfer / apollo-1-migration.md
Last active May 31, 2017 01:09
Migrating from Apollo Client 0.x to 1.0

Migrating from Apollo Client 0.x to 1.0

Here are the main breaking changes between the 0.x and 1.0 versions of Apollo Client.

fetchMore

The structure of fetchMoreResult has been changed. Previously fetchMoreResult used to contain data and loading fields, now fetchMoreResult is what fetchMoreResult.data used to be. This means your updateQueries function has to change as follows:

updateQuery: (prev, { fetchMoreResult }) => {
@nerdyworm
nerdyworm / rename.sh
Created July 30, 2016 17:40
rename a phoenix project
#!/bin/bash
set -e
CURRENT_NAME="CurentName"
CURRENT_OTP="current_name"
NEW_NAME="NewName"
NEW_OTP="new_name"

A proposal for a framework-agnostic way of building Javascript configuration objects based on different environments.

This proposal focuses on the conventions that will allow for the creation of a plain old JavaScript object. For example:

var environment = new Environment("development");
environment.name; // "development"
environment.config.API_ROOT; // "http://localhost:3000/"
@viniciussbs
viniciussbs / endpoints.md
Created December 10, 2015 20:13 — forked from derhuerst/_.md
List of HAFAS API Endpoints
@brandur
brandur / heroku-api-stub.md
Last active December 20, 2015 22:09
Engineering API-driven Applications Using Service Stubs

Engineering API-driven Applications Using Service Stubs

Developing applications against foreign services like the Heroku Platform API can unlock a powerful set of otherwise unavailable features, but can come with drawbacks: development must occur online, valid credentials are required, calls your code makes will reveal and manipulate real data, and API calls in tests have to stubbed out individually.

This article will offer a short overview on how these pain points can be

@brandur
brandur / twitter-auth.md
Last active February 13, 2020 22:13
Twitter auth

Easy Twitter API OAuth 2 Access

  1. Go to your applications. Create a new one, and find the values in the Consumer Key and Consumer Secret fields.

  2. Use OAuth client information to produce an OAuth 2 access token:

    curl -i --user <consumer_key>:<consumer_secret> -X POST https://api.twitter.com/oauth2/token -d "grant_type=client_credentials"
    
    {"access_token":"<oauth2_token>","token_type":"bearer"}% 
    
@vagnerzampieri
vagnerzampieri / .bash_aliases
Last active October 25, 2017 20:18
Alias público, se tiver coisas interessantes, contribua.
function mkcd(){
mkdir $1;
cd $1;
}
# Apt
alias apti='sudo apt-get install'
alias apts='sudo apt-cache search'
alias aptp='sudo apt-get --purge remove'
alias aptr='sudo apt-get remove'
@viniciussbs
viniciussbs / dev.conf
Created November 5, 2012 20:21 — forked from fnando/dev.conf
Nginx configuration for SSH tunnel
upstream tunnel {
server 127.0.0.1:3000;
}
server {
listen 80;
server_name dev.codeplane.com br.dev.codeplane.com;
location / {
proxy_set_header X-Real-IP $remote_addr;
@cgallagher
cgallagher / milestone.rb
Created June 13, 2012 10:28
Active Admin Image Upload Form
ActiveAdmin.register Milestone do
scope :all, :default => true
scope :global
scope :user_specific
index do
column :title
column :description
column :required_litres
column :is_active
@tapajos
tapajos / gist:1811460
Created February 12, 2012 23:05
Migrando do Heroku para a Amazon Web Services

Migrando do Heroku para a Amazon Web Services

Recentemente eu comentei sobre a migração que fizemos no [Myfinance][mf] saindo do [Heroku][h] e indo para a [Amazon Web Services][a] e diversas pessoas me perguntaram as razões pela qual fizemos essa mudança. O objetivo desse post é apenas explicar a decisão que a nossa equipe tomou, como foi e as conseguências dessa migração.

Antes de começar eu gostaria de deixar claro que o objetivo desse texto não é comparar hospedagens e nem dizer que uma é melhor do que a outra. Trata-se apenas do relato de uma experiência.

A motivação

Antes de explicar a motivação por trás da migração é interessante mostrar como era a nossa estrutura.