Skip to content

Instantly share code, notes, and snippets.

View stiakov's full-sized avatar
🚀

Santiago Torres stiakov

🚀
View GitHub Profile
@stiakov
stiakov / test.rb
Created April 21, 2020 16:48
Ruby interview memo
class Customer < ApplicationRecord
has_one :address
end
class Address < ApplicationRecord
belongs_to :customer
end
customers = Customer.where(attr: 1)

Keybase proof

I hereby claim:

  • I am stiakov on github.
  • I am stiakov (https://keybase.io/stiakov) on keybase.
  • I have a public key ASALyLUG2PEJIOrEaJpj3TUWF_gZD6eyCjaT13woOUg6Ggo

To claim this, I am signing this object:

@stiakov
stiakov / styles.css
Created February 13, 2020 00:39
Constrain boundaries to the Carousel
#carousel {
/* ... */
overflow-x: auto;
}
@stiakov
stiakov / gist:9f99286ac54ddf0c1f7d1b79fb62e026
Created October 16, 2019 18:12
Deploy to gh-pages from a nested folder.

Trying to deploy from a inner folder to gh-pages, you must have the transpiled assets in the desired directory.

If you want to deploy from the dist folder you should commit it to gh-pages branch.

  • Run this git subtree push --prefix dist origin gh-pages
  • In the GitHub project Settings, down to Github Pages, and in Source branch select: gh-pages.

That's it

@stiakov
stiakov / auto_login.md
Last active September 6, 2019 17:59
Automatize ssh logins

Automatize your remote logins through ssh

Requirements

You need expect scripting language to run this task.

  • In debian based distros run: $ sudo apt install expect

  • In MacOS: $ brew install expect

@stiakov
stiakov / docker_rpi.md
Last active September 5, 2019 16:46
Install Docker in Ubuntu Server Raspberry Pi

Install Docker in RPi

$ curl -sSL https://get.docker.com |sh

Reference link

@stiakov
stiakov / new_user_unix.md
Last active September 18, 2019 17:01
Creating or removing a new sudo user in unix

Add a new User

Log in to root account

$ sudo root

Create the new user, fill the new password, name, etc

$ adduser user_name

@stiakov
stiakov / send_files_ssh.md
Last active September 4, 2019 04:38
Send files through SSH

Send files to a remote computer through SSH:

$ scp /path/to/local.file user@m192.168.0.100:/Destiny/path

or send directories and its content with:

$ scp -r folder/name 192.168.0.100:/Destiny/path

Secure Copy Protocol | local_path/file | user@server:/destiny

@stiakov
stiakov / PG_ConnectionBad.md
Last active September 6, 2019 17:50
PG::ConnectionBad: could not connect to server in Rails

Trying to run a rails console in my development env, It has thrown this error:

PG::ConnectionBad: could not connect to server: Connection refused Is the server running on host "127.0.0.1" and accepting TCP/IP connections on port 5432?

Since I've used Brew to install PG, the fix that worked for me is in the steps below:

$ brew uninstall postgresql