Skip to content

Instantly share code, notes, and snippets.

View apotema's full-sized avatar

Alexandre Mondaini Calvão apotema

View GitHub Profile
Connecting to database specified by database.yml
 (0.2ms) BEGIN
 (0.2ms) SAVEPOINT active_record_1
User Exists (0.9ms) SELECT 1 AS one FROM "users" WHERE "users"."email" = 'user_0@example.com' LIMIT 1
SQL (3.5ms) INSERT INTO "users" ("admin", "created_at", "disabled", "email", "latitude", "longitude", "name", "password_digest", "score", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["admin", true], ["created_at", Fri, 02 Nov 2012 00:25:26 BRST -02:00], ["disabled", nil], ["email", "user_0@example.com"], ["latitude", 1.1], ["longitude", 1.1], ["name", "user_name_0"], ["password_digest", "$2a$10$lX66IDibk4YndXHWUnPsTOga2JKVZ7OZ8C9XCHrWzOAjG92/ztEZC"], ["score", 0], ["updated_at", Fri, 02 Nov 2012 00:25:26 BRST -02:00]]
 (0.3ms) RELEASE SAVEPOINT active_record_1
 (0.5ms) SAVEPOINT active_record_1
User Exists (0.7ms) SELECT 1 AS one FROM "use
@apotema
apotema / data_load.rb
Created November 24, 2012 19:49
Data load
require 'rubygems'
require 'sequel'
DB_MY = Sequel.connect('mysql://root@localhost/wikimapas_legacy')
DB_PG = Sequel.connect('postgres://alexandre@localhost/wikimaps_development')
categories_mysql = DB_MY[:categories].select{[id, name, created_at, updated_at]}
categories_ids = {}
categories_mysql.each do |category|
# my => pg
@apotema
apotema / include
Last active August 29, 2015 14:07
module Qbwc
module OrderedFields
module ClassMethods
def field attribute_name
@attr_order ||= []
@attr_order << attribute_name
attr_accessor attribute_name
end
def attr_order
Fellow Procorians,
I have spent part of my time working on the Quickbooks and on the HH2 system.
I have seen some points of improvement on the SAGE integration, one of them is related to repeated
code to access to the HH2 system. All along the code we can see this code to access the Hh2 systemm.
commitment_change_order_conversation.rb
```ruby
def flush_hh2_cco_queue(origin_id)

Fellow Procorians,

I have spent most of my time with you working on the QuickBooks microservice and on a microservice to host the current HH2 Sage integration code.

I have seen some points of improvement on the Sage integration, one in particular is related to repeated code used to access HH2. For example:

commitment_change_order_conversation.rb

def flush_hh2_cco_queue(origin_id)
  retry_cntr ||= 1
{"label":"coverage","message":"86%","schemaVersion":1,"color":"hsl(103, 100%, 40%)"}
@apotema
apotema / gist_content.md
Last active January 1, 2026 14:37
Architecture discussion: Simplifying labelle-tasks integration with labelle-engine

Simplifying labelle-tasks Integration with labelle-engine

Current Architecture Pain Points

1. Component Wrapper Boilerplate

Currently, bakery-game has component files that just wrap task engine calls:

// bakery-game/components/storage.zig
pub const Storage = struct {
@apotema
apotema / zig-0.15.2-macos-tahoe-fix.md
Created April 9, 2026 21:01
Zig 0.15.2 + macOS 26 Tahoe: DEVELOPER_DIR fix for arm64 linker errors

Zig 0.15.2 + macOS 26 (Tahoe): DEVELOPER_DIR fix for arm64 linker errors

TL;DR

export DEVELOPER_DIR=/Library/Developer/CommandLineTools

Add that to ~/.zshrc (or ~/.bashrc). Every zig build, zig build run, zig build test, and any tool that wraps them (e.g. labelle) will start working again.

@apotema
apotema / rfc-349-interactive.html
Last active April 24, 2026 15:28
RFC #349 — Mass formula updates · interactive prototype (Direction A modal)
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>RFC #349 — Mass Formula Updates · Prototype</title>
<meta name="viewport" content="width=device-width,initial-scale=1">
<!-- Pull the actual compiled stylesheet from manwah-development so the
prototype matches the live app exactly. Fingerprint pins to a
specific deploy; regenerate if assets change. -->
<link rel="stylesheet" href="https://manwah-development-347fcf73ac86.herokuapp.com/assets/application-ca2e3da3adfa8c9f708138ae51f034a16a24f5872db68607a923b4da7f9954de.css">