Skip to content

Instantly share code, notes, and snippets.

Avatar
🌊
Build that!

David Gil dgilperez

🌊
Build that!
View GitHub Profile
@ydarias
ydarias / gestion-conocimiento.md
Last active Sep 13, 2020
Cómo gestiono el conocimiento
View gestion-conocimiento.md

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.

@MarkMurphy
MarkMurphy / README.md
Last active Jul 16, 2020
ActiveRecord: Store Milliseconds (or Microseconds) in Timestamps with Rails / MySQL
View README.md

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 Dec 15, 2015 — forked from nkbt/.eslintrc.js
Strict ESLint config for React, ES6 (based on Airbnb Code style)
View .eslintrc.js
{
"env": {
"browser": true,
"node": true,
"es6": true
},
"plugins": ["react"],
"ecmaFeatures": {
@nthj
nthj / example.rb
Last active Oct 14, 2016
Methods I like to monkey-patch onto the Object class in Ruby
View example.rb
# 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 $!
View DigitalOcean_NoVNC_Paste.js
// 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 Apr 26, 2019
Demo HTTP/2 server with Puma
View h2_puma.rb
require 'socket'
require 'openssl'
require 'puma/server'
require 'ds9'
class Server < DS9::Server
def initialize socket, app
@app = app
@read_streams = {}
@write_streams = {}
@JoshCheek
JoshCheek / rails_sib.rb
Last active Feb 1, 2018
Rails app in 1 file, running with Seeing Is Believing
View rails_sib.rb
gem 'rails', '4.2.1' # prob works on others, too, but this is the one I figured it out on
require "rails"
require 'active_record'
require 'action_controller/railtie'
require 'action_view/railtie'
# ===== Configuration =====
Rails.logger = ActiveRecord::Base.logger = Logger.new $stdout
ActiveSupport::LogSubscriber.colorize_logging = false
@nkbt
nkbt / .eslintrc.js
Last active Sep 16, 2020
Strict ESLint config for React, ES6 (based on Airbnb Code style)
View .eslintrc.js
{
"env": {
"browser": true,
"node": true,
"es6": true
},
"plugins": ["react"],
"ecmaFeatures": {
@brianhempel
brianhempel / bench_rails_memory_usage.rb
Last active Apr 5, 2020
A script to test the memory usage of your Rails application over time. It will run 30 requests against the specified action and report the final RSS. Choose the URL to hit on line 45 and then run with `ruby bench_rails_memory_usage.rb`.
View bench_rails_memory_usage.rb
require "net/http"
def start_server
# Remove the X to enable the parameters for tuning.
# These are the default values as of Ruby 2.2.0.
@child = spawn(<<-EOC.split.join(" "))
XRUBY_GC_HEAP_FREE_SLOTS=4096
XRUBY_GC_HEAP_INIT_SLOTS=10000
XRUBY_GC_HEAP_GROWTH_FACTOR=1.8
XRUBY_GC_HEAP_GROWTH_MAX_SLOTS=0
View react-app-file-structure
.
├── actions
├── stores
├── views
│   ├── Anonymous
│   │   ├── __tests__
│   │   ├── views
│   │   │   ├── Home
│   │   │   │   ├── __tests__
│   │   │   │   └── Handler.js
You can’t perform that action at this time.