Skip to content

Instantly share code, notes, and snippets.

View misselliev's full-sized avatar
🌱
Growing

Elizabeth Villalejos misselliev

🌱
Growing
View GitHub Profile
@chriswilkinsoncodes
chriswilkinsoncodes / conditionals.js
Last active December 31, 2020 21:19
React: Use && with Conditionals
{ this.state.display && <h1>Display True!</h1> }
{ !this.state.display && <h1>Display False!</h1> }
{ (this.state.counter === 5) && <h1>Display Five!</h1> }
@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 / 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

@adriaanbd
adriaanbd / ror-cap-spec.md
Last active August 14, 2019 00:18
RAILS RSPEC CAPYBARA PSQL CONFIG ROR

RSPEC CAPYBARA PSQL ROR CONFIG

A Ruby on Rails configuration for RSpec Capybara testing with a postgres database.

Create app

Postgres, and skip test files:

rails new capyspecpsql -d postgres -T
@db0sch
db0sch / regenerate_credentials.md
Last active July 30, 2024 12:59
How to regenerate the master key for Rails 5.2 credentials

If your master.key has been compromised, you might want to regenerate it.

No key regeneration feature at the moment. We have to do it manually.

  1. Copy content of original credentials rails credentials:show somewhere temporarily.
  2. Remove config/master.key and config/credentials.yml.enc
  3. Run EDITOR=vim rails credentials:edit in the terminal: This command will create a new master.key and credentials.yml.enc if they do not exist.
  4. Paste the original credentials you copied (step 1) in the new credentials file (and save + quit vim)
  5. Add and Commit the file config/credentials.yml.enc
@thegitfather
thegitfather / vanilla-js-cheatsheet.md
Last active July 17, 2025 02:58
Vanilla JavaScript Quick Reference / Cheatsheet
@PurpleBooth
PurpleBooth / README-Template.md
Last active November 3, 2025 11:24
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@cobyism
cobyism / gh-pages-deploy.md
Last active October 31, 2025 17:43
Deploy to `gh-pages` from a `dist` folder on the master branch. Useful for use with [yeoman](http://yeoman.io).

Deploying a subfolder to GitHub Pages

Sometimes you want to have a subdirectory on the master branch be the root directory of a repository’s gh-pages branch. This is useful for things like sites developed with Yeoman, or if you have a Jekyll site contained in the master branch alongside the rest of your code.

For the sake of this example, let’s pretend the subfolder containing your site is named dist.

Step 1

Remove the dist directory from the project’s .gitignore file (it’s ignored by default by Yeoman).