Skip to content

Instantly share code, notes, and snippets.

View benoror's full-sized avatar
🌀
In a quantum state between coding and procrastinating

Ben Orozco benoror

🌀
In a quantum state between coding and procrastinating
View GitHub Profile
@benoror
benoror / long_query.rb
Created October 5, 2023 16:08
Modularize a long/complex SQL query in Ruby
def my_big_ish_report
my_long_query = ```sql
SELECT a,b,c FROM ... AS q_a
JOIN (
SELECT ... ' Sub-query 1
WHERE client_id = 'foobar'
) sq_1 ON q_a.fkey_id = sq_1.id
INNER JOIN (
SELECT x,y,z FROM ... ' Sub-query 2
JOIN (
@benoror
benoror / README.md
Created May 13, 2022 17:06 — forked from tannerlinsley/README.md
Replacing Create React App with the Next.js CLI

Replacing Create React App with the Next.js CLI

How dare you make a jab at Create React App!?

Firstly, Create React App is good. But it's a very rigid CLI, primarily designed for projects that require very little to no configuration. This makes it great for beginners and simple projects but unfortunately, this means that it's pretty non-extensible. Despite the involvement from big names and a ton of great devs, it has left me wanting a much better developer experience with a lot more polish when it comes to hot reloading, babel configuration, webpack configuration, etc. It's definitely simple and good, but not amazing.

Now, compare that experience to Next.js which for starters has a much larger team behind it provided by a world-class company (Vercel) who are all financially dedicated to making it the best DX you could imagine to build any React application. Next.js is the 💣-diggity. It has amazing docs, great support, can grow with your requirements into SSR or static site generation, etc.

So why

@benoror
benoror / psql_fuzzy_search.md
Last active January 13, 2022 01:18
Research: PostgreSQL Fuzzy Search

Algorithms

Levenshtein (a.k.a. match difference)

Levenshtein distance is a string metric for measuring the difference between two sequences. Informally, the Levenshtein distance between two words is the minimum number of single-character edits (i.e. insertions, deletions or substitutions) required to change one word into the other.

Soundex (a.k.a. match soundalikes)

@benoror
benoror / user.rb
Created May 20, 2011 01:38
devise_invitable: Confirm after set password
class User < ActiveRecord::Base
devise :invitable, :database_authenticatable, :registerable, :recoverable,
:rememberable, :confirmable, :validatable, :encryptable
# ...
# devise confirm! method overriden
def confirm!
welcome_message
super
@benoror
benoror / cover_letter.md
Last active May 20, 2021 21:04
Cover Letter - Ben Orozco - benoror.com

Hi, my name is Ben Orozco. I am a Computer Science Engineer specialized in Full Stack web development, passionate on making and launching software products, leading engineering teams and leveraging technology to tackle big real-world problems. Portfolio: https://benoror.com/portfolio

I am passionate of full stack development (APIs, backend, DevOps, front-end, UI/UX) for the past 9+ years, mainly in Ruby on Rails, Node.js, Elixir and Javascipt frameworks (React, Angular, Ember).

I am ready for my next career challenge! Some fun projects I have been part of that might be relevant:

  • Helped planning, architecture design and hands-on programming of a full AuthN/AuthZ identity provider based on OAuth2/OpenID standards, to support SSO (Single Sign-on) and User Management across many EdTech applications.

  • Launched a Node.js Tax/Invoicing lambda micro-service in record time that ended up replacing a big chunk of a Java monolith codebase and serving 1000's or requests per minute by relying on minimal footprint

@benoror
benoror / ERP_DBA.md
Last active February 12, 2021 19:43
SQL Database Administrator (DBA)

SQL Database Administrator (DBA)

San Luis Potosi, Mexico

About the Position

Support the development of new generation in-house ERP, by extending data model and enhancing current business processes, while supporting existing users and testing a new technology for rapid prototyping of business applications

Responsibilities

  • Implement and normalize data model via scalable business rules by interacting with both technical and non-technical customers
@benoror
benoror / export_base_meta_from_airtable.js
Created December 10, 2020 05:37 — forked from wassim/export_base_meta_from_airtable.js
Export base meta data from Airtable
const fda = ( fields ) => {
let data = []
for(const f of fields ){
data.push(fd(f))
}
return data
}
const fd = ( field ) => {
let data = {
@benoror
benoror / README.md
Created September 23, 2020 15:53 — forked from ggondim/README.md
Airtable schema API request

Airtable Schema API

Replace the variables below in the script

  • YOURBASEID: your Airtable base ID starting with 'app...'
  • YOURCOOKIESFORAIRTABLEDOMAIN your browser cookie for airtable.com domain
@benoror
benoror / airtable-proxy.js
Last active April 19, 2020 10:51
Node.js Airtable API Proxy
var express = require('express');
var proxy = require('http-proxy-middleware');
var options = {
logLevel: 'debug',
target: 'https://api.airtable.com/v0/' + process.env.APP_ID,
changeOrigin: true,
headers: {
'Accept': 'application/json',
'Authorization': 'Bearer ' + process.env.API_KEY
},
@benoror
benoror / index.js
Created December 3, 2019 22:56
Simple self-auth Airtable Proxy in Node.js
var express = require('express');
var proxy = require('http-proxy-middleware'); // This one does most of the heavy lifting
var axios = require('axios');
var base64 = require('base-64');
var cors = require('cors')
require('dotenv').config()
var options = {
target: 'https://api.airtable.com/v0/' + process.env.APP_ID, // Airtable ENV var