Skip to content

Instantly share code, notes, and snippets.

View mayoralito's full-sized avatar
:octocat:
This is the way!

amayoral mayoralito

:octocat:
This is the way!
View GitHub Profile
@mayoralito
mayoralito / fb-ads-removal.js
Last active June 3, 2018 17:33
Facebook Scripting Tools
function removeAds() {
var allItems = document.querySelectorAll('._2b2e ._2b2p');
for (var item of allItems) {
var isAdEnabled = (item.getAttribute('data-tooltip-content').toLowerCase() == "remove");
if (isAdEnabled) {
item.click();
}
}
}
console.log("Starting removing ads from facebook prefences!");
# Get all packages and save it to ENV variable
PACKAGES_TO_UPDATE=`npm outdated | awk '{print "npm install", $1"@latest", "--save; \n\r" }'`
# Save output to a location
echo $PACKAGES_TO_UPDATE > /tmp/npm-update-packages.log
# Open the file and remove the first line
# TODO: use awk to remove the first line of the file
vim /tmp/npm-update-packages.log
# Copy the content of the file and paste it on the terminal
# TODO: Create an script to get the output from npm outdated command and run the update against the latest version.
//Trying out a prefix operator
//I thought vertical elipses made sense, representative of rbg
prefix operator ⋮
prefix func ⋮(hex:UInt32) -> Color {
return Color(hex)
}
extension Color {
init(_ hex: UInt32, opacity:Double = 1.0) {
let red = Double((hex & 0xff0000) >> 16) / 255.0
Tue Mar 10 05:20:01 UTC 2020
// File: APIService.swift
import Foundation
import Combine
enum APIServiceError: Error {
case responseError
case parseError(Error)
}
protocol APIRequestType {
@mayoralito
mayoralito / amazon-s3-design-principles.md
Last active June 9, 2021 04:33
amazon-s3-design-principles

Amazon S3 Design Principles

The following principles of distributed system design were used to meet Amazon S3 requirements:

Decentralization: Use fully decentralized techniques to remove scaling bottlenecks and single points of failure.

Asynchrony: The system makes progress under all circumstances.

Autonomy: The system is designed such that individual components can make decisions based on local information.

Local responsibility: Each individual component is responsible for achieving its consistency; this is never the burden of its peers.