Skip to content

Instantly share code, notes, and snippets.

View fagiani's full-sized avatar

Paulo Fagiani fagiani

View GitHub Profile
@fagiani
fagiani / optimize-images.sh
Created August 5, 2022 04:26 — forked from rkbhochalya/optimize-images.sh
Recursively optimize PNG and JPEG images using convert command
# Recursively optimize PNG and JPEG images using convert command
#
# `convert` is part of ImageMagick (http://www.imagemagick.org/). You will need to install it first.
#
# Author: Rajendra Kumar Bhochalya (http://rkb.io)
#
# @see https://developers.google.com/speed/docs/insights/OptimizeImages
# Optimize all JPEG images in current directory and subdirectories
find . -name "*.jpg" -exec convert "{}" -sampling-factor 4:2:0 -strip -quality 85 -interlace JPEG -colorspace RGB "{}" \; -exec echo "{}" \;
@fagiani
fagiani / aws_sqs_migrate.sh
Created May 24, 2021 16:26
Migrate/Move/Transfer SQS queues between AWS accounts
#!/bin/bash
# This script aims to copy/move AWS SQS queues between accounts using CLI profiles
# It will include tags and attributes
# It will postpone creation of queues that require deadletter queues
# It will create users with tags and related boundary permissions policy related to a queue
# It will postpone creation of queues that require users/policies
# It will process postponed queues recursively
# Regarding queues, users and policies, this script currently DOES NOT:
@fagiani
fagiani / taggable.rb
Created March 9, 2011 19:22
This is the current refactor I am working on
# Copyright (c) 2010 Wilker Lúcio <wilkerlucio@gmail.com>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
//This will alert the self HTML
$.getJSON("?callback=?http://twitter.com/followers/ids/" + username + ".json",
function(data){
alert(data);
});
//This will alert the JSON data retrieved
$.getJSON("http://twitter.com/followers/ids/" + username + ".json?callback=?",
function(data){
alert(data);