Skip to content

Instantly share code, notes, and snippets.

@leonardofed
leonardofed / README.md
Last active April 17, 2024 13:42
A curated list of AWS resources to prepare for the AWS Certifications


A curated list of AWS resources to prepare for the AWS Certifications

A curated list of awesome AWS resources you need to prepare for the all 5 AWS Certifications. This gist will include: open source repos, blogs & blogposts, ebooks, PDF, whitepapers, video courses, free lecture, slides, sample test and many other resources.


@JamieCressey
JamieCressey / dynamodb_item_to_dict.py
Last active June 30, 2021 11:49
Coverts a Python Boto3 DynamoDB item to a standard dictionary
def parse_dynamo_item(item):
resp = {}
if type(item) is str:
return item
for key,struct in item.iteritems():
if type(struct) is str:
if key == 'I':
return int(struct)
else:
return struct
@amosshapira
amosshapira / get-all-s3-prefix-lists
Created December 2, 2015 03:54
Fetch the S3 prefix list ID's for S3 in all AWS regions. These are can then be used as destinations in route tables
#!/bin/bash
# Fetch the S3 prefix list ID's for S3 in all AWS regions.
# These are can then be used as destinations in route tables
aws ec2 describe-regions --query 'Regions[*].RegionName' | \
jq -r '.[]' | \
while read REGION
do
echo ==== $REGION ====
@marcellodesales
marcellodesales / ec2-host-from-tag-to-env-vars.sh
Last active November 8, 2022 11:49
Create Environment Variables in EC2 Hosts from EC2 Host Tags, just like Beanstalk or Heroku does!
######
# Author: Marcello de Sales (marcello.desales@gmail.com)
# Description: Create Create Environment Variables in EC2 Hosts from EC2 Host Tags
#
### Requirements:
# * Install jq library (sudo apt-get install -y jq)
# * Install the EC2 Instance Metadata Query Tool (http://aws.amazon.com/code/1825)
#
### Installation:
# * Add the Policy EC2:DescribeTags to a User
@sr75
sr75 / osx-homebrew-setup.md
Last active June 18, 2020 06:35
Mac Yosemite OSX - Homebrew (RVM/MySQL/Redis) setup

Mac Homebrew (RVM/MySQL/Redis) setup

Follow the steps below to setup a local development environment:

XQuartz

Recommended to download latest XQuartz

iTerm2

@sr75
sr75 / wget-jdk-oracle-install-example.txt
Last active March 16, 2023 11:28
wget command to install Oracle JAVA JDK from stupid oracle website for centos and ubuntu
http://d.stavrovski.net/blog/post/how-to-install-and-setup-oracle-java-jdk-in-centos-6
# rpm
wget --no-cookies \
--no-check-certificate \
--header "Cookie: oraclelicense=accept-securebackup-cookie" \
"http://download.oracle.com/otn-pub/java/jdk/7u55-b13/jdk-7u55-linux-x64.rpm" \
-O jdk-7-linux-x64.rpm
# ubuntu
@sr75
sr75 / bash_profile
Last active June 8, 2018 03:34
Nice simple bash_profile & bashrc for rbenv/python/node/sublime/brew & bash completion terminal setup with colors on osx mavericks
# rbenv & brew git/bash completion terminal setup
# for dev desktop only on osx
# Run the following commands in order to use this script:
################################################################
# !! => Update/Install xcode Command Line Tools <= !!
# In your shell/terminal:
# Homebrew perms needed:
# sudo chown -R root:admin /usr/local
# sudo chown -R root:admin /Library/Caches/Homebrew
# ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
@sr75
sr75 / code-style-guides.md
Last active December 24, 2015 14:09
(Google/jQuery) HTML/CSS & JavaScript Code Style guides links:
@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
@sr75
sr75 / mysql_max_text_limits_active_record.rb
Created April 15, 2013 15:09
mysql 5.6 rails active_record migration text max lengths for a database created with utf8
# just an active_record migration example for reference
# source of this logic: https://github.com/rails/rails/blob/master/activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb
class CreateMetaTexts < ActiveRecord::Migration
def up
create_table :meta_texts do |t|
t.text :default_text_63KB, limit: 63.kilobytes # 64512 < 65535 limit for when text datatype changes to mediumtext datatype
t.text :medium_text_64KB, limit: 64.kilobytes # 65536 > 65535 limit and triggers text datatype to mediumtext datatype
t.text :medium_text_15MB, limit: 15.megabytes # 15728640 < 16777215 limit for when mediumtext changes to longtext datatype