Skip to content

Instantly share code, notes, and snippets.

View jvidalba1's full-sized avatar

Mateo Vidal jvidalba1

  • Medellín - Colombia
View GitHub Profile
If you have a method or attribute in a class, you could invoke the send() method in order to call those
methods or attributes.
In my case, I was confused when I was trying to do a validator for my class Transaction which has
another class associated Account, and there is a class called Entity.
I needed validate that an specific account was created in the Account model and belonged to the
same entity.
====
@jvidalba1
jvidalba1 / gist:8918272
Created February 10, 2014 15:49
Error installing pg gem

This is the error:

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

/home/likewise-open/VISIONAMOS/jvidal/.rvm/rubies/ruby-2.1.0/bin/ruby extconf.rb

checking for pg_config... yes

Using config values from /usr/bin/pg_config

@jvidalba1
jvidalba1 / unzipping
Last active August 29, 2015 13:57
List of commands to get files from compressed folders
- Descomprimir .tgz
```
$ tar -xvzf archivo.tgz
```
- Descomprimir .tar
```
$ tar -xvf archivo.tar
@jvidalba1
jvidalba1 / mysqldump.md
Last active August 29, 2015 13:57
Export data from mysql by command line
  • Export only data
mysqldump -u [username] -p --no-create-db --no-create-info [database_name]+ [table_name]* > [filename]+.sql 
  • Export only structure
mysqldump -u [username] -p --no-data [database_name]+ [table_name]* > [filename]+.sql 
@jvidalba1
jvidalba1 / transfer_data.md
Last active August 29, 2015 13:57
Transfer data via scp
  • Send data from local to server
scp -P [port_number] [files_to_send] [user]@[ip_server]:[folder_in_server]

How to install Ruby 1.9.3-p392 on Mac OSX 10.8+

RVM:

rvm get stable && rvm reload

Firstly, the OpenSSL comes with your OSX 10.8+ is outdated, you need to get latest version

=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')
@jvidalba1
jvidalba1 / main
Created June 26, 2014 19:10
problems
Problem topic: postgres
-> Error: psql: could not connect to server: No such file or directory
-> The solution which worked for me:
a pid file was blocking postgres from starting up. To fix it:
rm /usr/local/var/postgres/postmaster.pid
and then all is well.
@jvidalba1
jvidalba1 / mac_install.md
Last active September 6, 2023 04:29 — forked from edymerchk/mac_install.txt
Mac installation environment

iTerm2

http://iterm2.com/

Oh my ZSH

https://github.com/robbyrussell/oh-my-zsh

HomeBrew