Skip to content

Instantly share code, notes, and snippets.

View dgilperez's full-sized avatar
🌊
Build that!

David Gil dgilperez

🌊
Build that!
View GitHub Profile
@JaimeObregon
JaimeObregon / organizaciones_fungibles.md
Last active February 5, 2025 01:22
Organizaciones fungibles

Organizaciones Fungibles

Este documento es público y cualquiera puede evolucionarlo.

💡 Nombres alternativos:

  • Organización efímera
  • Organización fugaz
  • Organización fungible

¿Y si reinventamos la manera de organizarnos para resolver problemas?

@rameerez
rameerez / exit_the_cloud.md
Last active February 19, 2025 07:58
☁️ How I got off the cloud and migrated everything from AWS to a VPS in Hetzner

☁️ How I got off the cloud and migrated everything from AWS to a VPS in Hetzner

This is an opinionated handbook on how I migrated all my Rails apps off the cloud and into VPS.

This is how I manage real production loads for my Rails apps. It assumes:

  • Rails 7+
  • Ruby 3+
  • PostgreSQL
  • Ubuntu Server 24.04
  • Capistrano, Puma, Nginx
@zanona
zanona / sentry-serverless-firebase.ts
Last active September 4, 2024 19:51
Missing Sentry's firebase serverless wrappers
/**
* Temporary wrapper for firebase functions until @sentry/serverless support is implemented
* It currently supports wrapping https, pubsub and firestore handlers.
* usage: https.onRequest(wrap((req, res) => {...}))
*/
import type {Event} from '@sentry/types';
import type {https} from 'firebase-functions';
import type {onRequest, onCall} from 'firebase-functions/lib/providers/https';
import type {ScheduleBuilder} from 'firebase-functions/lib/providers/pubsub';
import type {DocumentBuilder} from 'firebase-functions/lib/providers/firestore';
@ydarias
ydarias / gestion-conocimiento.md
Last active December 17, 2024 07:15
Cómo gestiono el conocimiento

Cómo gestiono el conocimiento

Hace unos días una amiga me preguntó cómo gestionaba el conocimiento que iba adquiriendo. Dónde lo "guardo", cómo lo "organizo". Y es una muy buena pregunta.

Al principio pensé que era una pregunta bastante fácil de responder, pero si lo piensas con detenimiento, el conocimiento proviene de muchas fuentes diferentes. Y me empecé a plantear esbozarlo en un papel, y entonces la pregunta se transformó en, ¿tengo un proceso para gestionar el conocimiento?

Para empezar voy a descartar mi mayor fuente de conocimiento, que es la experiencia real. En el día a día, a medida que voy haciendo cosas aprendo y cambio mis hábitos, eso es conocimiento que queda "por hacer las cosas".

Por otra parte también voy a descartar conocimiento que saco de asistir a conferencias, ya que es importante pero es algo más esporádico. En estos casos tomo notas en mi libreta que posteriormente pueden pasar al proceso que voy a explicar, o no.

@aortbals
aortbals / squash-and-merge-cli.md
Last active March 6, 2025 18:54
Squash and Merge on the Command line

With the introduction of GitHub's Squash and Merge feature, this has become less prevelant, however it's still useful in scenarios where GitHub's interface is unavailable.

Let's talk through two ways to do a squash and merge on the command line.

Take 1: Interactive Rebase

When to use it

  • When you have not merged main into your feature branch
  • There are no merge conflicts
@MarkMurphy
MarkMurphy / README.md
Last active February 17, 2025 09:26
ActiveRecord: Store Milliseconds (or Microseconds) in Timestamps with Rails / MySQL

ActiveRecord: Store Milliseconds (or Microseconds) in DateTimes or Timestamps with Rails / MySQL

Milliseconds in your DateTimes or Timestamps.

We got 'em, you want 'em.

NOTE: only MySQL 5.6.4 and above supports DATETIME's with more precision than a second. For reference see MySQL 5.6.4 Changelog

Why

Shit needs to be PRECISE

@dgilperez
dgilperez / .eslintrc.js
Created December 15, 2015 13:58 — forked from nkbt/.eslintrc.js
Strict ESLint config for React, ES6 (based on Airbnb Code style)
{
"env": {
"browser": true,
"node": true,
"es6": true
},
"plugins": ["react"],
"ecmaFeatures": {
@nthj
nthj / example.rb
Last active October 14, 2016 19:32
Methods I like to monkey-patch onto the Object class in Ruby
# Say you want to look up the attrs of a Stripe Event for logging to your internal database.
attrs = begin
retriable(Stripe::APIConnectionError, Stripe::APIError, max: 25) do
# ... retrieve attrs from the Stripe event here...
end
rescue Stripe::APIConnectionError, Stripe::APIError
# We're inside an SQS queue block
throw :skip_delete # we'll just have to wait on this event, come back later
rescue Stripe::Error
notify $!
// This will open up a prompt for text to send to a console session on digital ocean
// Useful for long passwords
(function () {
var t = prompt("Enter text to be sent to console, (This wont send the enter keystroke)").split("");
function f() {
var character = t.shift();
var i=[];
var code = character.charCodeAt();
var needs_shift = "!@#$%^&*()_+{}:\"<>?~|".indexOf(character) !== -1
@tenderlove
tenderlove / h2_puma.rb
Last active August 14, 2024 06:10
Demo HTTP/2 server with Puma
require 'socket'
require 'openssl'
require 'puma/server'
require 'ds9'
class Server < DS9::Server
def initialize socket, app
@app = app
@read_streams = {}
@write_streams = {}