Skip to content

Instantly share code, notes, and snippets.

View petersonfs's full-sized avatar

Peterson F. dos Santos petersonfs

View GitHub Profile
@petersonfs
petersonfs / main.workflow
Created September 9, 2021 22:18 — forked from supersaiyane/main.workflow
Github Actions with Amazon EKS CI/CD
workflow "Demo workflow" {
on = "push"
resolves = ["SNS Notification"]
}
action "Build Image" {
uses = "actions/docker/cli@c08a5fc9e0286844156fefff2c141072048141f6"
runs = ["/bin/sh", "-c", "docker build -t $IMAGE_URI ."]
env = {
IMAGE_URI = "xxxxxxxx.dkr.ecr.ap-northeast-1.amazonaws.com/github-action-demo:latest"
@petersonfs
petersonfs / osx-10.10-setup.md
Created September 30, 2015 10:44 — forked from kevinelliott/osx-10.10-setup.md
Mac OS X 10.10 Yosemite Setup

Mac OS X 10.10 Yosemite

Custom recipe to get OS X 10.10 Yosemite running from scratch, setup applications and developer environment. I use this gist to keep track of the important software and steps required to have a functioning system after a semi-annual fresh install. On average, I reinstall each computer from scratch every 6 months, and I do not perform upgrades between distros.

This keeps the system performing at top speeds, clean of trojans, spyware, and ensures that I maintain good organizational practices for my content and backups. I highly recommend this.

You are encouraged to fork this and modify it to your heart's content to match your own needs.

Install Software

# Nginx+Unicorn best-practices congifuration guide. Now with SPDY!
# We use latest stable nginx with fresh **openssl**, **zlib** and **pcre** dependencies.
# Some extra handy modules to use: --with-http_stub_status_module --with-http_gzip_static_module
#
# Deployment structure
#
# SERVER:
# /etc/init.d/nginx (1. nginx)
# /home/app/public_html/app_production/current (Capistrano directory)
#
gem 'omniauth'
gem 'omniauth-facebook'
gem 'clearance'
@petersonfs
petersonfs / Gemfile
Created January 6, 2013 14:24 — forked from soffes/Gemfile
source 'https://rubygems.org'
# The latest version of Ruby
ruby '1.9.3'
# The lastest version of Rails
gem 'rails', '3.2.10'
# Postgres
gem 'pg'
# 1) Point *.example.com in your DNS setup to your server.
#
# 2) Setup an Apache vhost to catch the star pointer:
#
# <VirtualHost *:80>
# ServerName example.com
# ServerAlias *.example.com
# </VirtualHost>
#
# 3) Set the current account from the subdomain
grupos que sei da existência:
* Guru-SP
  * Guru-SP-Interior
* Guru-Campinas (SP)
  * Guru-CE
  * Guru-PI
  * Rails-MG 
  * Guru-SC
* Guru-BA

Blocks (inclui explicação do método lambda)

Blocks não são objetos. Então se eu quiser atribuir um block a uma variável, eu tenho que converter ele para um objeto. E é isso que faz o método lambda no Ruby.

O método Lambda não recebe parâmetros, apenas um block. Ele faz parte do module Kernel do Ruby. Para termos uma idéia de como funciona o método Lambda, ele apresenta uma lógica de construção semelhante à essa:

Module Kernel
	def lambda(&block)

Proc.new(&block)