Skip to content

Instantly share code, notes, and snippets.

View EdgarOrtegaRamirez's full-sized avatar
📝
​Learning!

Edgar Ortega EdgarOrtegaRamirez

📝
​Learning!
  • Barranquilla, Colombia
  • 16:10 (UTC -05:00)
View GitHub Profile
@gigkokman
gigkokman / fixing-failed-building-psycopg2-mac
Last active September 20, 2019 19:19
Failed building wheel for psycopg2 <ld: library not found for -lssl> with pip
``` ld: library not found for -lssl
clang: error: linker command failed with exit code 1 (use -v to see invocation)
error: command 'clang' failed with exit status 1```
Point LDFLAGS to OpenSSL's lib & include directories
```env LDFLAGS="-L$(brew --prefix openssl)/lib" CFLAGS="-I$(brew --prefix openssl)/include" pip install -r environments/development.txt```
@kasappeal
kasappeal / django-postgresql-gunincorn-nginx-pyenv-ubuntu-16.04.md
Last active September 26, 2022 11:30
How to deploy a Django app with PostgreSQL + Gunicorn + Nginx using pyenv on Ubuntu Server 16.04

How to deploy a Django app with PostgreSQL + Gunicorn + Nginx using pyenv on Ubuntu Server 16.04

This guide shows how to setup a production environment for a Django application using PostgreSQL as database, Gunicorn as application server and Nginx as http server using Ubuntu Server 14.04 as Operative System.

Install PosgreSQL, Nginx, Git and Circus

Install PostgreSQL and Nginx using:

sudo apt-get install -y postgresql-9.5 postgresql-contrib-9.5 postgresql-server-dev-9.5 nginx git circus make build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev libncursesw5-dev xz-utils python-setuptools 
@niksumeiko
niksumeiko / disable-html-form-input-autocomplete-autofill.md
Last active April 1, 2025 23:38
Disable HTML form input autocomplete and autofill

Disable HTML Form Input Autocomplete and Autofill

  1. Add autocomplete="off" onto <form> element;
  2. Add hidden <input> with autocomplete="false" as a first children element of the form.
<form autocomplete="off" method="post" action="">
    <input autocomplete="false" name="hidden" type="text" style="display:none;">
    ...
@wvengen
wvengen / README.md
Last active January 5, 2025 05:20
Ruby memory analysis over time

Finding a Ruby memory leak using a time analysis

When developing a program in Ruby, you may sometimes encounter a memory leak. For a while now, Ruby has a facility to gather information about what objects are laying around: ObjectSpace.

There are several approaches one can take to debug a leak. This discusses a time-based approach, where a full memory dump is generated every, say, 5 minutes, during a time that the memory leak is showing up. Afterwards, one can look at all the objects, and find out which ones are staying around, causing the

@filmgirl
filmgirl / el-capitan-install-usb
Last active November 30, 2019 04:05
Create Bootable USB Drive for OS X El Capitan
sudo /Applications/Install\ OS\ X\ El\ Capitan.app/Contents/Resources/createinstallmedia --volume /Volumes/Untitled --applicationpath /Applications/Install\ OS\ X\ El\ Capitan.app --nointeraction
@romansklenar
romansklenar / db.rake
Created April 1, 2015 18:08
Useful rake task for maintain PostgreSQL databases
# lib/tasks/db.rake
namespace :db do
desc 'Maintains database by running command as ANALYZE, VACUUM and REINDEX'
task maintain: :environment do
verbose = ENV['VERBOSE'].present?
connection = ActiveRecord::Base.connection
puts "Maintaining database #{connection.current_database} ..."
connection.execute("VACUUM FULL #{'VERBOSE' if verbose}")
require 'securerandom'
require 'set'
tokens = Set.new
i = ENV['I'].to_i
length = ENV['KEY_LENGTH'].to_i
i.times do |i|
@waj
waj / ecr-macros.cr
Created December 18, 2014 21:47
Crystal Layouts with ECR
macro embed_ecr(filename, io_name)
\{{ run("ecr/process", {{filename}}, {{io_name}}) }}
end
macro ecr_file(filename)
def to_s(__io__, section = nil)
embed_ecr {{filename}}, "__io__"
end
def to_s(__io__, &block)
class ApplicationController < ActionController::Base
protect_from_forgery with: :exception
def index
render text: index_html
end
private
def index_html
# config/routes.rb
resources :documents do
resources :versions, controller: "documents/versions" do
post :restore, on: :member
end
resource :lock, controller: "documents/locks"
end