Skip to content

Instantly share code, notes, and snippets.

@choyno
choyno / multiple-ssh-keys-git.adoc
Created January 23, 2024 05:39 — forked from alejandro-martin/multiple-ssh-keys-git.adoc
Configure multiple SSH Keys for Git

Use Multiple SSH Keys for Git host websites (Github, Gitlab)

This is guide about how to configure multiple SSH keys for some Git host websites such as Github, Gitlab, among others.

Creating SSH keys

  1. Create SSH directory:

@choyno
choyno / ssh-agent.md
Created January 20, 2024 05:41 — forked from mvneves/ssh-agent.md
"Could not open a connection to your authentication agent"

SSH authentication agent does not automatically start when using it from a remote server. This results in the following error message:

$ git pull
Permission denied (publickey).
fatal: The remote end hung up unexpectedly
$ ssh-add ~/my-ssh-key.pem
Could not open a connection to your authentication agent.

To fix it requires manually starting ssh-agent:

@choyno
choyno / simple-pagination.js
Created March 23, 2021 05:17 — forked from kottenator/simple-pagination.js
Simple pagination algorithm
// Implementation in ES6
function pagination(c, m) {
var current = c,
last = m,
delta = 2,
left = current - delta,
right = current + delta + 1,
range = [],
rangeWithDots = [],
l;
@choyno
choyno / mamp.md
Created November 16, 2020 00:23 — forked from jfloff/mamp.md
How to get MAMP to work with SSL ... Yes really.

First of all you need to be able to run MAMP in port 80. This is a "heat check" if you don't have any process jamming http ports. You can check it like this:

sudo lsof | grep LISTEN

If you do happen to have any process with something like this *:http (LISTEN), you are in trouble. Before with adventure check if it isn't MAMP itself (yeah, you should close that beforehand)

ps <pid of that process>

If you don't see MAMP, you are in good hands, I have just the thing for you:

@choyno
choyno / install-yarn.md
Created December 1, 2018 15:31 — forked from mikerourke/install-yarn.md
Upgrades/Installation in Cloud9

Installing Yarn in Cloud9

You can't just follow the directions on the site, you have to do some mojo first.

Step 1. Run update.

sudo apt-get update

Step 2. Install apt-transport-https.

@choyno
choyno / rspec_model_testing_template.rb
Created November 12, 2018 08:51 — forked from SabretWoW/rspec_model_testing_template.rb
Rails Rspec model testing skeleton & cheat sheet using rspec-rails, shoulda-matchers, shoulda-callbacks, and factory_girl_rails. Pretty much a brain dump of examples of what you can (should?) test in a model. Pick & choose what you like, and please let me know if there are any errors or new/changed features out there. Reddit comment thread: http…
# This is a skeleton for testing models including examples of validations, callbacks,
# scopes, instance & class methods, associations, and more.
# Pick and choose what you want, as all models don't NEED to be tested at this depth.
#
# I'm always eager to hear new tips & suggestions as I'm still new to testing,
# so if you have any, please share!
#
# @kyletcarlson
#
# This skeleton also assumes you're using the following gems:
@choyno
choyno / gist:a699edc709d958ce8db532d77664417b
Created November 27, 2017 16:32 — forked from Atlas7/gist:d0c0680ae573a72e2d3d
Rails: Reinstall postgreSQL via brew ang pg gem on Mac OS X
$ brew uninstall postgresql
$ gem uninstall pg # ALL OF THEM
$ rm -fr /usr/local/var/postgres
$ launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist
$ pg_ctl -D /usr/local/var/postgres stop -s -m fast # WE SHOULD HAVE ALL postgres SERVERS & PROCESSES STOPPED BY NOW
$ brew install postgres
$ env ARCHFLAGS="-arch x86_64" gem install pg
$ echo "DONE." >> /dev/null
@choyno
choyno / Setup for Ruby on Rails development.md
Created June 22, 2017 03:45 — forked from fzrhrs/Setup for Ruby on Rails development.md
How to Install Xcode, Homebrew, Git, RVM, Ruby, Rails, Heroku Toolbelt and Postgres (Yosemite)

###Step 1: Install XCode

Check if the full Xcode package is already installed:

$ xcode-select -p

If you see:

/Applications/Xcode.app/Contents/Developer

@choyno
choyno / Setup for Ruby on Rails development.md
Created June 22, 2017 03:45 — forked from fzrhrs/Setup for Ruby on Rails development.md
How to Install Xcode, Homebrew, Git, RVM, Ruby, Rails, Heroku Toolbelt and Postgres (Yosemite)

###Step 1: Install XCode

Check if the full Xcode package is already installed:

$ xcode-select -p

If you see:

/Applications/Xcode.app/Contents/Developer

@choyno
choyno / self-signed-localhost-for-rails.txt
Created September 22, 2016 13:55 — forked from webdevotion/self-signed-localhost-for-rails.txt
SSL self signed localhost for rails start to finish, no red warnings.
# SSL self signed localhost for rails start to finish, no red warnings.
# 1) Create your private key (any password will do, we remove it below)
$ openssl genrsa -des3 -out server.orig.key 2048
# 2) Remove the password
$ openssl rsa -in server.orig.key -out server.key