Skip to content

Instantly share code, notes, and snippets.

View juanhuttemann's full-sized avatar

Juan Hüttemann juanhuttemann

  • Asunción, Paraguay
View GitHub Profile
require 'open3'
require 'reline'
class Reline::LineEditor
private def perform_completion(list, _just_show_list)
_preposing, target, _postposing = retrieve_completion_block
namespace = IRB.CurrentContext.io.retrieve_doc_namespace(target)
namespace = namespace.first if namespace.is_a?(Array)
if namespace.nil? || !('A'..'Z').include?(namespace[0])
namespace = IRB.conf[:__MAIN__]
@tomholford
tomholford / install_pg_gem.md
Last active February 9, 2025 14:31
Install postgresql gem `pg` on macOS

Installing pg gem on macOS

If you're trying to install the postgresql gem pg and it is failing with the following error message:

Installing pg 1.2.3 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    current directory: ~/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/pg-1.2.3/ext
~/.rbenv/versions/3.0.0/bin/ruby -I ~/.rbenv/versions/3.0.0/lib/ruby/3.0.0 -r ./siteconf20210125-97201-pycpo.rb extconf.rb
@qoomon
qoomon / TravisGitHub.md
Last active September 16, 2024 18:50
Setup GitHub Deploy Keys For Travis
@waleedahmad
waleedahmad / post_install.sh
Last active February 11, 2025 17:52
Ubuntu post installation script for installing software of your choice.
#!/bin/bash
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root"
exit 1
else
#Update and Upgrade
echo "Updating and Upgrading"
apt-get update && sudo apt-get upgrade -y
@parmentf
parmentf / GitCommitEmoji.md
Last active April 30, 2025 21:43
Git Commit message Emoji
@ik5
ik5 / colors.go
Last active January 3, 2025 00:23
Simple golang expirement with ANSI colors
package main
// http://play.golang.org/p/jZ5pa944O1 <- will not display the colors
import "fmt"
const (
InfoColor = "\033[1;34m%s\033[0m"
NoticeColor = "\033[1;36m%s\033[0m"
WarningColor = "\033[1;33m%s\033[0m"
ErrorColor = "\033[1;31m%s\033[0m"
DebugColor = "\033[0;36m%s\033[0m"
@johnpolacek
johnpolacek / .gitconfig
Last active March 8, 2025 22:15
My current .gitconfig aliases
[alias]
recent = "!git for-each-ref --sort=-committerdate refs/heads/ --format='%(committerdate:short) %(refname:short)' | head -n 10"
co = checkout
cob = checkout -b
coo = !git fetch && git checkout
br = branch
brd = branch -d
brD = branch -D
merged = branch --merged
st = status
@jwo
jwo / mysql.database.yml
Last active March 28, 2025 04:51
Sample config/database.yml from Rails. Postgres, MySQL, and SQLite
#
# Install the MYSQL driver
# gem install mysql2
#
# Ensure the MySQL gem is defined in your Gemfile
# gem 'mysql2'
#
# And be sure to use new-style password hashing:
# http://dev.mysql.com/doc/refman/5.0/en/old-client.html
development:
@xdite
xdite / 42-things.md
Created July 14, 2012 05:11
Ten (42) Things You Didn't Know Rails Could Do