Skip to content

Instantly share code, notes, and snippets.

View henrymazza's full-sized avatar

Fabio Mazarotto henrymazza

View GitHub Profile
@henrymazza
henrymazza / gist:3975283
Created October 29, 2012 18:02
Animate Window Resize
try
set front_app to (path to frontmost application as Unicode text)
set c to 3
tell application front_app
activate
set {l, t, r, b} to bounds of window 1
log {l, t, r, b}
repeat until (((b - 150 - 804) ^ 2) ^ 0.5) < 2
set b to b + (150 + 804 - b) / c
# frozen_string_literal: true
# How to test:
#
# ```sh
# curl -i -N http://localhost:3000/feeds/stream
# ```
#
# What I should see:
# * the ouput "hello world" 10x separated by a send of each other

Artigo Alex

  1. bio ainda tá “Elisebot.ai”
  2. I like the concept of fixing things that are broken, nas not otherwise.
  3. another famous:

The line of code that’s the fastest to write, that never breaks, that doesn’t need maintenance, is the line you never had to write. — Jobs

  1. uncle bob puts the role of tests under another spot, like a protection against dynamic Languages: https://www.youtube.com/watch?v=YX3iRjKj7C0
  2. Just enough code vs doc clarity? Won’t make people practice Code Golf?
  3. “test code is liability” better title / click bait?
  4. does it imply tests outside in? Cucumber -> unit? (+1 for mocking is useless) (ok, later you make clearer your preference for black boxes)

3 Projects I Worked On

Retail Management (2015-19) 🏬

Ember.js SPA made the POS screen, inventory management grids, barcode product search, invoices. Live data refreshes were pushed from the server through ActionCable and websockets using the JSON:API standard. I18n support for front and backend by i18n gem and ember-intl package. SASS, Coffeescript, Babel as assets pre-processors with Webpack.

# frozen_string_literal: true
require 'rails_helper'
RSpec.describe 'FeedsController with Capybara', type: :feature do
before do
# control group
create_list :auction, 10, :with_lots, lots_size: 10, start_date: 5.years.ago,
end_date: 4.years.ago
end
@henrymazza
henrymazza / docker-exec-all
Last active March 28, 2021 04:08 — forked from timhodson/runCommandAllDockers.sh
Run a command on all docker containers
#!/bin/sh
if [ $# -eq 0 ]; then
echo "No arguments provided"
exit 1
fi
for container in `docker ps -q`; do
# show the name of the container
printf '%-40s' $(docker inspect --format='{{.Name}}' $container)
version: '3.9'
services:
sidekiq:
depends_on: [ redis, db, bg_sync ]
image: nemo:x86
platform: linux/amd64
web:
depends_on: [ redis, db, bg_sync ]
# frozen_string_literal: true
class Hello
def self.world
'helloworld'
end
def self.rand_list(length, lowerb, upperb)
0.upto(length - 1).map do
rand(lowerb..upperb)