Skip to content

Instantly share code, notes, and snippets.

View phensalves's full-sized avatar
👾
MCMXC

No More Cookies phensalves

👾
MCMXC
  • London, UK
View GitHub Profile
module TweetsHelper
def build_tweets_hash tweets
@tweets_array = []
tweets.each do |tweet|
tweet_hash = {
user: tweet['user']['screen_name'],
user_profile: ENV['TWITTER_URL'] + tweet['user']['id'].to_s,
followers_count: tweet['user']['followers_count'],
retweets: tweet['retweet_count'],
@phensalves
phensalves / gitflow-breakdown.md
Created April 4, 2019 17:10 — forked from JamesMGreene/gitflow-breakdown.md
A comparison of using `git flow` commands versus raw `git` commands.

Initialize

gitflow git
git flow init git init
  git commit --allow-empty -m "Initial commit"
  git checkout -b develop master

Connect to the remote repository

HTTP status code symbols for Rails
Thanks to Cody Fauser for this list of HTTP responce codes and their Ruby on Rails symbol mappings.
Status Code Symbol
1xx Informational
100 :continue
101 :switching_protocols
102 :processing
@phensalves
phensalves / user_controller.rb
Created March 11, 2023 22:59
Examples for Clean Architecture article
class UserController < ApplicationController
def index
@users = User.all
end
def create
@user = User.new(user_params)
if @user.save
redirect_to users_path
else