cd | Directorio Principal |
cd [folder] | Cambiar Directorio |
ls | Lista de todo |
ls -a | Lista incluyendo archivos ocultos |
mkdir [dir] | Crear carpeta |
mkdir -p [dir]/[dir] | Crear carpeta dentro de otra carpeta |
sudo [command] | Acción con super permiso |
open [file] | Abre |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#https://stackoverflow.com/questions/58065603/netlify-renders-404-on-page-refresh-using-react-and-react-router | |
[[redirects]] | |
from = "/*" | |
to = "/index.html" | |
status = 200 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
web: bundle exec puma -t 5:5 -p ${PORT:-3000} -e ${RACK_ENV:-development} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import { Switch, Route } from 'react-router-dom'; | |
import { Container } from 'semantic-ui-react'; | |
import Navbar from './components/shared/Navbar'; | |
import Home from './components/shared/Home'; | |
import Nomatch from './components/shared/Nomatch'; | |
import Login from './components/auth/Login'; | |
import Register from './components/auth/Register'; | |
import FetchUser from './components/auth/FetchUser'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const youtubeID = (link) => link.slice(link.lastIndexOf('=')+1); | |
console.log(youtubeID('https://www.youtube.com/watch?v=N65RvNkZFGE')); | |
const shortLink = (short) => short.slice(short.lastIndexOf('e/')+2); | |
console.log(shortLink('https://youtu.be/N65RvNkZFGE')); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#YOUTUBE | |
def youtube_id | |
youtube_id = self.modelkey | |
youtube_id.gsub("https://www.youtube.com/watch?v=", "") | |
end | |
#Call as @model.youtube_id | |
<iframe width="560" height="315" src="https://www.youtube.com/embed/<%= @.youtube_id %>" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe> | |
#SPOTIFY |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module ControllerMacros | |
def login_user | |
before(:each) do | |
@request.env["devise.mapping"] = Devise.mappings[:user] | |
@user = User.create(email: '[email protected]', password: 'password', | |
first_name: 'Test', last_name: 'Tester', age: 27) | |
sign_in @user | |
end | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This file is copied to spec/ when you run 'rails generate rspec:install' | |
require 'spec_helper' | |
ENV['RAILS_ENV'] ||= 'test' | |
require File.expand_path('../../config/environment', __FILE__) | |
# Prevent database truncation if the environment is production | |
abort("The Rails environment is running in production mode!") if Rails.env.production? | |
require 'rspec/rails' | |
require 'simplecov' | |
SimpleCov.start |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# READ - GET | |
# Page will see and interact with | |
# shows record from the db onto the pages | |
# index action - see all of the record for the table | |
@model_names = Model_name.all | |
# gets all the records and set them to a variable | |
# show action - see a single record, id | |
@model_name = Model_name.find(params[:id]) |