Skip to content

Instantly share code, notes, and snippets.

View Mardiniii's full-sized avatar

Sebastian Zapata Mardini Mardiniii

View GitHub Profile
@Mardiniii
Mardiniii / com.googlecode.iterm2.plist
Created September 21, 2022 21:10
iterm2 Settings
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>AlternateMouseScroll</key>
<true/>
<key>AppleAntiAliasingThreshold</key>
<integer>1</integer>
<key>ApplePressAndHoldEnabled</key>
<false/>
@Mardiniii
Mardiniii / job-search-make-it-real.md
Last active December 2, 2020 05:18
Links from the Job Search - Make It Real talk.

Técnicas para encontrar empleo como desarrollador Web

Definition

Search Criteria:

  • Modalidad
  • Compensación
  • Tipo de compañía
  • Tecnologías
@Mardiniii
Mardiniii / curl.md
Created February 14, 2019 16:41 — forked from subfuzion/curl.md
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@Mardiniii
Mardiniii / adapter.rb
Created June 1, 2018 05:46
Design Patterns using Ruby
# Adaptee
class Hammer
def swing
'swing'
end
end
# Target
class Tool
def initialize(adapter)
@Mardiniii
Mardiniii / dip.rb
Last active May 30, 2018 18:17
Dependency Injection Principle: Entities must depend on abstractions not on concretions. It states that the high level module must not depend on the low level module, but they should depend on abstractions.
# Violates DIP
class InvoiceNotifier
def initialize(invoice)
@invoice = invoice
end
def mail_notification
InvoiceMailer.new.send(@invoice)
end
@Mardiniii
Mardiniii / isp.rb
Last active May 30, 2018 18:05
Interface segregation principle: A client should never be forced to implement an interface that it doesn't use or clients shouldn't be forced to depend on methods they do not use.
# Violates ISP
class Airplane
def load_luggage
end
def load_fuel
end
def take_off
end
@Mardiniii
Mardiniii / lsp.rb
Created May 28, 2018 20:44
Liskov Sustitution Principle: Let q(x) be a property provable about objects of x of type T. Then q(y) should be provable for objects y of type S where S is a subtype of T.
# Violates LSP
class Company
def hire_people
expand_the_team
end
def open_new_location
create_a_new_office
end
@Mardiniii
Mardiniii / ocp.rb
Last active May 30, 2018 21:51
Open-closed Principle: Objects or entities should be open for extension, but closed for modification.
# Violates OCP
class InvoiceNotifier
def initialize(invoice)
@invoice = invoice
end
def notify(channel)
case channel
when 'email'
send_email
@Mardiniii
Mardiniii / srp.rb
Created May 28, 2018 20:38
Single Responsability Principle: A class should have one and only one reason to change, meaning that a class should have only one job.
# Violates SRP
class Invoice
def initialize(items, client)
@items = items
@client = client
@total = 0
end
def generate
@Mardiniii
Mardiniii / data_replication_problem.rb
Last active May 24, 2018 18:56
1st approach to solve data replication problem using Ruby.
require 'minitest/autorun'
# Problem
# https://softwareengineering.stackexchange.com/questions/153806/conflict-resolution-for-two-way-sync
# interface DB {
# String Get(String)
# void Set(String, String)
# []String Keys()
#