Skip to content

Instantly share code, notes, and snippets.

View jesus-sayar's full-sized avatar

Jesus Sayar Celestino jesus-sayar

View GitHub Profile
@jesus-sayar
jesus-sayar / google_inventory
Created January 29, 2018 18:38
Inventory for servers in Google Cloud
#!/usr/bin/env python
import requests
import subprocess
import json
STAGE = 'production'
def use_internal(instance):
if in_gce:
@jesus-sayar
jesus-sayar / dummy_hotel.py
Last active July 24, 2017 14:50
Dummy hotel probe using Selenium
class DummyHotel(Probe):
URL = 'http://www.dummy-hotel.com'
DESTINATION = 'Vigo, Galicia'
def execute(self):
self.visit_home()
self.search_destination()
self.select_hotel()
self.select_room()
@jesus-sayar
jesus-sayar / selenium_with_browser_mob.py
Last active September 21, 2018 22:32
Selenium + BrowserMob Proxy configuration
self.bmp_server = Server(‘/Users/dummy/browsermob_proxy_binary’)
self.bmp_server.start()
self.web_proxy = self.bmp_server.create_proxy()
self.web_proxy.new_har(“web_har_data”, options={‘captureHeaders’: True})
 
profile = webdriver.FirefoxProfile()
profile.set_preference(“network.proxy.type”, 1)
profile.set_preference(“network.proxy.http”, “localhost”)
profile.set_preference(“network.proxy.http_port”, self.web_proxy.port)
profile.set_preference(“network.proxy.ssl”, “localhost”)
@jesus-sayar
jesus-sayar / gist:115e5da42d52d4cb2b661f7c0c0388db
Created July 20, 2016 20:32 — forked from SzymonPobiega/gist:5220595
DDD/CQRS/ES/Architecture videos

If you have two days to learn the very basics of modelling, Domain-Driven Design, CQRS and Event Sourcing, here's what you should do:

In the evenings read the [Domain-Driven Design Quickly Minibook]{http://www.infoq.com/minibooks/domain-driven-design-quickly}. During the day watch following great videos (in this order):

  1. Eric Evans' [What I've learned about DDD since the book]{http://www.infoq.com/presentations/ddd-eric-evans}
  2. Eric Evans' [Strategic Design - Responsibility Traps]{http://www.infoq.com/presentations/design-strategic-eric-evans}
  3. Udi Dahan's [Avoid a Failed SOA: Business & Autonomous Components to the Rescue]{http://www.infoq.com/presentations/SOA-Business-Autonomous-Components}
  4. Udi Dahan's [Command-Query Responsibility Segregation]{http://www.infoq.com/presentations/Command-Query-Responsibility-Segregation}
  5. Greg Young's [Unshackle Your Domain]{http://www.infoq.com/presentations/greg-young-unshackle-qcon08}
  6. Eric Evans' [Acknowledging CAP at the Root -- in the Domain Model]{ht

agnoster.zsh-theme

A ZSH theme optimized for people who use:

  • Solarized
  • Git
  • Unicode-compatible fonts and terminals (I use iTerm2 + Menlo)

For Mac users, I highly recommend iTerm 2 + Solarized Dark

@jesus-sayar
jesus-sayar / set_monitors
Last active September 15, 2019 12:32
Configure Dell XPS 13' with HiDPI and external monitor
#!/bin/sh
one_monitor () {
echo "Configure one monitor!"
# Window scaling down
gsettings set org.gnome.desktop.interface scaling-factor 2
xrandr --output eDP1 --mode 3200x1800 --primary --scale 1x1 --output HDMI1 --off
}
two_monitors () {
@jesus-sayar
jesus-sayar / KeyBindings.sublime-keymap
Created October 23, 2015 07:46
Sublime Key Bindings
[
{ "keys": ["ctrl+alt+super+d"], "command": "toggle_side_bar" },
{ "keys": ["super+l"], "command": "show_overlay", "args": {"overlay": "goto", "text": ":"} },
{ "keys": ["super+shift+l"], "command": "expand_selection", "args": {"to": "line"} },
{ "keys": ["ctrl+super+r"], "command": "reveal_in_side_bar" },
{ "keys": ["alt+shift+up"], "command": "select_lines", "args": {"forward": false} },
{ "keys": ["alt+shift+down"], "command": "select_lines", "args": {"forward": true} },
{ "keys": ["ctrl+shift+<"], "command": "erb" },
{ "keys": ["super+shift+t"], "command": "reopen_last_file" },
{ "keys": ["super+i"], "command": "copy_path" },
{
"color_scheme": "Packages/User/SublimeLinter/Monokai Bright (SL).tmTheme",
"theme": "Spacegray.sublime-theme",
"font_size": 12,
"highlight_line": true,
"ignored_packages":
[
"Vintage"
],
"save_on_focus_lost": true,