Skip to content

Instantly share code, notes, and snippets.

View misselliev's full-sized avatar
🌱
Growing

Elizabeth Villalejos misselliev

🌱
Growing
View GitHub Profile
@misselliev
misselliev / fcc-personal-portfolio.markdown
Created October 22, 2018 19:02
FCC: Personal portfolio
@misselliev
misselliev / ror-cap-spec.md
Created August 14, 2019 00:18 — forked from adriaanbd/ror-cap-spec.md
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
@misselliev
misselliev / vanilla-js-cheatsheet.md
Created September 26, 2019 21:14 — forked from thegitfather/vanilla-js-cheatsheet.md
Vanilla JavaScript Quick Reference / Cheatsheet
@misselliev
misselliev / gh-pages-deploy.md
Created October 16, 2019 03:56 — forked from cobyism/gh-pages-deploy.md
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).

@misselliev
misselliev / gist:8d5db268f231e355670c58aa820b7405
Created November 1, 2019 16:46 — forked from stiakov/gist:9f99286ac54ddf0c1f7d1b79fb62e026
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

@misselliev
misselliev / Redux using connect component
Last active February 24, 2020 20:07
Redux using connect component
import React from 'react';
import { connect } from 'react-redux';
import Book from '../components/Book';
import { removeBook } from '../actions';
const filtering = (books, filterRes) => (filterRes === 'All' ? books : books.filter(book => book.category === filterRes));
const BookList = ({ books, filter }) => (
<div>
{filtering(books, filter).map(book => (
@misselliev
misselliev / Redux using hooks
Last active February 24, 2020 20:08
Redux using hooks
import React from 'react';
import { useDispatch, useSelector, shallowEqual } from 'react-redux';
import Book from '../components/Book';
import { removeBook } from '../actions';
const filtering = (books, filterRes) => (filterRes === 'All' ? books : books.filter(book => book.category === filterRes));
export default BookList = () => {
const books = useSelector(state => state.books, shallowEqual) || [];
const filter = useSelector(state => state.filter) || {};
import React from 'react';
import PropTypes from 'prop-types';
interface BannerProps {
BannerImg: string;
AltImg: string;
}
const Banner: React.FC<BannerProps> = ({ BannerImg, AltImg }) => {
return (
<div>
import React from 'react';
const Menubar: React.FC = () => {
return (
<div className="container mx-auto">
<nav className="flex justify-between p-8 items-center mb-16">
<a href="#" className="font-sans text-black md:text-white text-sm md:text-4xl font-thin">
The 1975 - NOACF
</a>
<ul className="list-reset flex">