Skip to content

Instantly share code, notes, and snippets.


Sebastian Zapata Mardini Mardiniii

View GitHub Profile
Mardiniii /
Last active Dec 2, 2020
Links from the Job Search - Make It Real talk.

Técnicas para encontrar empleo como desarrollador Web


Search Criteria:

  • Modalidad
  • Compensación
  • Tipo de compañía
  • Tecnologías
Mardiniii /
Created Feb 14, 2019 — forked from subfuzion/
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 / adapter.rb
Created Jun 1, 2018
Design Patterns using Ruby
View adapter.rb
# Adaptee
class Hammer
def swing
# Target
class Tool
def initialize(adapter)
Mardiniii / dip.rb
Last active May 30, 2018
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.
View dip.rb
# Violates DIP
class InvoiceNotifier
def initialize(invoice)
@invoice = invoice
def mail_notification
Mardiniii / isp.rb
Last active May 30, 2018
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.
View isp.rb
# Violates ISP
class Airplane
def load_luggage
def load_fuel
def take_off
Mardiniii / lsp.rb
Created May 28, 2018
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.
View lsp.rb
# Violates LSP
class Company
def hire_people
def open_new_location
Mardiniii / ocp.rb
Last active May 30, 2018
Open-closed Principle: Objects or entities should be open for extension, but closed for modification.
View ocp.rb
# Violates OCP
class InvoiceNotifier
def initialize(invoice)
@invoice = invoice
def notify(channel)
case channel
when 'email'
Mardiniii / srp.rb
Created May 28, 2018
Single Responsability Principle: A class should have one and only one reason to change, meaning that a class should have only one job.
View srp.rb
# Violates SRP
class Invoice
def initialize(items, client)
@items = items
@client = client
@total = 0
def generate
Mardiniii / data_replication_problem.rb
Last active May 24, 2018
1st approach to solve data replication problem using Ruby.
View data_replication_problem.rb
require 'minitest/autorun'
# Problem
# interface DB {
# String Get(String)
# void Set(String, String)
# []String Keys()
Mardiniii / searchFormHandler.js
Last active Apr 30, 2018
Code snippet for medium post
View searchFormHandler.js
$(document).ready(function() {
function parseResponse(resultsContainer, data) {
const resultsAmount = data.pages.length
if (resultsAmount > 0) {
$.each(data.pages, function(index, page) {
appendToResults(resultsContainer, page)
setResultsTitle(resultsAmount + " results found it for: " + data.input, 'green')