Skip to content

Instantly share code, notes, and snippets.

View backpackerhh's full-sized avatar
🏠
Working from home

David Montesdeoca backpackerhh

🏠
Working from home
View GitHub Profile
@backpackerhh
backpackerhh / backpackerhh.json
Created August 27, 2024 18:41
Configuration for iTerm2
{
"Ansi 7 Color (Light)" : {
"Red Component" : 0.7810397744178772,
"Color Space" : "sRGB",
"Blue Component" : 0.78104829788208008,
"Alpha Component" : 1,
"Green Component" : 0.78105825185775757
},
"Ansi 15 Color (Light)" : {
"Red Component" : 0.99999600648880005,
@backpackerhh
backpackerhh / keybindings.json
Last active August 28, 2024 17:44
Keybindings for VSCode in macOS
[
// Custom
{
"key": "shift+alt+up",
"command": "editor.action.insertCursorAbove",
"when": "editorTextFocus"
},
{
"key": "shift+alt+down",
"command": "editor.action.insertCursorBelow",
@backpackerhh
backpackerhh / karabiner.json
Last active August 29, 2024 11:14
Karabiner-Elements config
{
"global": { "show_in_menu_bar": false },
"profiles": [
{
"devices": [
{
"identifiers": {
"is_keyboard": true,
"is_pointing_device": true,
"product_id": 45913,
@backpackerhh
backpackerhh / INSTRUCTIONS.md
Last active August 14, 2024 07:28
Safebox API

Safebox API Challenge

Security-ish is a security company which main business is taking care of houses and people belongings.

Their next product launch is Safe-ish, a remote-control safebox that they sell to their customer in order to keep their belongings as safe as possible, providing them the ability to control their safebox remotely through a mobile app.

As you know, the API should be strong and secure enough to avoid leaks and security issues.

@backpackerhh
backpackerhh / instructions.md
Last active May 7, 2024 13:37
Safebox API Challenge

Safebox API Challenge

Security-ish is a security company which main business is taking care of houses and people belongings.

Their next product launch is Safe-ish, a remote-control safebox that they sell to their customer in order to keep their belongings as safe as possible, providing them the ability to control their safebox remotely through a mobile app.

As you know, the API should be strong and secure enough to avoid leaks and security issues.

@backpackerhh
backpackerhh / config.rb
Last active May 4, 2024 22:12
Configuration holder
class Config
def initialize(options = {})
@config = options.each_with_object({}) do |(key, value), memo|
memo[key.to_sym] = assign_value(value)
end
rescue NoMethodError
raise ArgumentError, "Invalid value name"
end
def method_missing(method_name, *args, &block)
@backpackerhh
backpackerhh / domain_events_providers.rb
Created March 25, 2024 18:26
Event bus implemented in Ruby
YourApp.register_provider :domain_events, namespace: true do # dry-system
prepare do
Dir[target.root.join("path/to/**/*_event_subscriber.rb")].each { |file| require file }
register "subscribers", EventSubscriber.subclasses
end
start do
register "bus", InMemoryEventBus.new
register "async_bus", SidekiqEventBus.new

Keybase proof

I hereby claim:

  • I am backpackerhh on github.
  • I am backpackerhh (https://keybase.io/backpackerhh) on keybase.
  • I have a public key ASAbGAEAN_vx-W97CRO0GG3xEQReFKUk6y65OpxeZCaPugo

To claim this, I am signing this object:

@backpackerhh
backpackerhh / remove-old-snaps.sh
Created October 2, 2023 08:43
Remove old snaps in Ubuntu
#!/bin/bash
# Removes old revisions of snaps
# CLOSE ALL SNAPS BEFORE RUNNING THIS
set -eu
snap list --all | awk '/disabled/{print $1, $3}' |
while read snapname revision; do
snap remove "$snapname" --revision="$revision"
done
@backpackerhh
backpackerhh / feature_helpers.rb
Last active March 3, 2017 09:10
Custom helpers for integration/acceptance tests
module FeatureHelpers
# Finds a file field on the page and attach a file given its path
def enhanced_attach_file(path)
field = find('input[type=file]', visible: false)
page.execute_script %($("##{field[:id]}").show())
attach_file field[:id], path.to_s
end
# Finds a file field on the page and attach a file given its path
def enhanced_attach_file(path)