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
@ydarias
ydarias / gestion-conocimiento.md
Last active January 8, 2023 20:07
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.

@jwo
jwo / registrations_controller.rb
Created September 30, 2011 23:11
API JSON authentication with Devise
class Api::RegistrationsController < Api::BaseController
respond_to :json
def create
user = User.new(params[:user])
if user.save
render :json=> user.as_json(:auth_token=>user.authentication_token, :email=>user.email), :status=>201
return
else
@brianhempel
brianhempel / bench_rails_memory_usage.rb
Last active October 6, 2022 12:47
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`.
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
@tacsio
tacsio / Git Configs
Last active September 15, 2022 01:10
My git config
git config --global user.name "Tarcisio Coutinho"
git config --global user.email "tcs5cin@gmail.com"
git config --global color.ui true
git config --global alias.s status
git config --global alias.c checkout
git config --global alias.b branch
git config --global alias.lol log --oneline --graph --decorate
.
├── actions
├── stores
├── views
│   ├── Anonymous
│   │   ├── __tests__
│   │   ├── views
│   │   │   ├── Home
│   │   │   │   ├── __tests__
│   │   │   │   └── Handler.js
@krisf
krisf / enc
Last active August 13, 2022 00:02
decrypts OpenSSL encrypted files from ruby Backup gem
#!/bin/bash
#encrypt files with aes-256-cbc cipher using openssl
#install:
# sudo wget -O /usr/bin/enc https://gist.github.com/krisf/5391210/raw/4a105a6b8f98f39e9e74a1dd2a78ef6f631acdb1/enc
# sudo chmod +x /usr/bin/enc
# enc --help
#encrypt files
if [ $1 == "-e" ];
then
@ryanb
ryanb / abilities.rb
Created September 15, 2012 19:23
How you can break up large Ability class in CanCan
module Abilities
def self.ability_for(user)
if user.admin?
AdminAbility.new(user)
else user
MemberAbility.new(user)
else
GuestAbility.new
end
end
@MarkMurphy
MarkMurphy / README.md
Last active March 25, 2022 21:47
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

@txus
txus / delegate_matcher.rb
Created February 2, 2011 09:19
RSpec matcher for delegations
# RSpec matcher to spec delegations.
#
# Usage:
#
# describe Post do
# it { should delegate(:name).to(:author).with_prefix } # post.author_name
# it { should delegate(:month).to(:created_at) }
# it { should delegate(:year).to(:created_at) }
# end
@furi2
furi2 / gist:1378595
Created November 19, 2011 07:36
Uploading multipart/form-data type data from Titanium
var content = '';
var boundary = '---------------------------170062046428149';
content += '--'+ boundary + '\r\n';
content += 'Content-Disposition: form-data; name="uploadToken"\r\n';
content += '\r\n';
content += upload_token + '\r\n';
content += '--'+ boundary + '\r\n';
content += 'Content-Disposition: form-data; name="destFolderPath"\r\n';
content += '\r\n';