Skip to content

Instantly share code, notes, and snippets.

View keybase.md

Keybase proof

I hereby claim:

  • I am johand on github.
  • I am johand (https://keybase.io/johand) on keybase.
  • I have a public key whose fingerprint is 7AC6 D647 EE90 7337 AB41 2FAC 410E 032B 7EAB 9A85

To claim this, I am signing this object:

@johand
johand / dependencies.md
Created Jun 26, 2015
dependencies for irssi scripts in gentoo
View dependencies.md
dev-perl/Crypt-OpenSSL-Bignum
virtual/perl-Math-BigInt
dev-perl/class-loader
sci-mathematics/pari
dev-perl/Math-BigInt-GMP
dev-perl/math-pari
dev-perl/crypt-random
dev-perl/crypt-dh
dev-perl/Crypt-Blowfish
View makefile
PDF_FLAGS = --fontsize 9.0 \
no-links \
no-toc \
charset iso-8859-1
MD = ../capitulos/00-inicio.md \
../capitulos/01-numeros.md \
../capitulos/02-textos.md \
../capitulos/03-variables.md \
../capitulos/04-conversiones.md \
@johand
johand / saas-course.rb
Created Jan 27, 2013
saas course week2-hw1
View saas-course.rb
#hw 1-1: fun with strings
def palindrome?(str)
letters = str.downcase.scan(/\w/)
letters == letters.reverse
end
def count_words(str)
str = str.downcase.split
words = {}
@johand
johand / install.sh
Created Aug 21, 2013
heroku toolbelt installer without sudo
View install.sh
HEROKU_CLIENT_URL="http://assets.heroku.com.s3.amazonaws.com/heroku-client/heroku-client.tgz"
echo "This script requires superuser access to install software."
echo "You will be prompted for your password."
su -c "sh <<SCRIPT
# download and extract the client tarball
rm -rf /usr/local/heroku
mkdir -p /usr/local/heroku
View git-alias.md

Colección de alias para GIT

Información para agregar un alias aquí

  • Git log con colores
lg = log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr)%C(bold blue)<%an>%Creset' --abbrev-commit
  • Git log en formato JSON
@johand
johand / README.md
Created Oct 5, 2018
Rails test suite
View README.md

Rails test suite

Configuration for

  • RSpec
  • shoulda matchers
  • capybara
  • factorybot
  • database_cleaner
  • omniauth-facebook
@johand
johand / dijkstra.rb
Created Apr 13, 2019
Dijkstra’s algorithm in ruby
View dijkstra.rb
class Dijkstra
attr_reader :graph, :costs, :parents, :processed
def initialize(graph, costs, parents)
@graph = graph
@costs = costs
@parents = parents
@processed = []
end
@johand
johand / mpd.md
Created Mar 28, 2016
mpd + ncmpcpp + pulseaudio with systemd in archlinux
View mpd.md

Installation

pacman -S mpd ncmpcpp

MPD

copy the example configuration in mpd.conf

# cp /usr/share/doc/mpd/mpdconf.example /etc/mpd.conf
@johand
johand / upgrading_pg.md
Created Nov 18, 2018
Upgrading PostgreSQL to a major version in Archlinux
View upgrading_pg.md

Upgrading PostgreSQL to a major version in Archlinux

# pacman -S postgresql-old-upgrade

# systemctl stop postgresql.service
# mv /var/lib/postgres/data /var/lib/postgres/olddata