In your command-line run the following commands:
brew doctor
brew update
git status // show files with and without stage | |
git add file.js // save changes to stage | |
git reset file.js // undo stage of file.js | |
git commit // commit changes staged with a comment | |
git log // show commits | |
git push origin master // origin is the upstream and master is the branch | |
git remote -v // show upstream | |
git remote set-url origin url.git // changes origin upstream | |
git branch // show you current branch and all the branchs |
psql -U postgres // start postgres shell or command line interface. | |
Some interesting flags (to see all, use -h or --help depending on your psql version): | |
-E: will describe the underlaying queries of the \ commands (cool for learning!) | |
-l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS) | |
Most \d commands support additional param of __schema__.name__ and accept wildcards like *.* | |
\q: Quit/Exit | |
\l list all the databases | |
\c __database__: Connect to a database |
In your command-line run the following commands:
brew doctor
brew update
import React from "react"; | |
import MediaQuery from "react-responsive"; | |
import Icon from "./icon.js"; | |
function KPICard({ title, value, icon, iconColor }) { | |
return ( | |
<div className="kpi-card"> | |
{/* Mobile view */} | |
<MediaQuery maxWidth={576}> | |
<div className="kpi-card__mobile__align kpi-card__style"> |
.kpi-card { | |
flex: 0 0 100%; | |
max-width: 100%; | |
padding: 8px; | |
@include bp-medium { | |
flex-basis: 0; | |
flex-grow: 1; | |
max-width: 100%; | |
} | |
} |
describe("<KPICard />", () => { | |
beforeEach(() => { | |
mountedComponentMobile = mountComponentMobile(mockedProps); | |
mountedComponentWeb = mountComponentWeb(mockedProps); | |
}); | |
it("should be defined", () => { | |
expect(mountedComponentMobile).toBeDefined(); | |
expect(mountedComponentMobile.type()).toEqual(KPICard); | |
expect(mountedComponentWeb).toBeDefined(); |
import React from "react"; | |
import { Context as ResponsiveContext } from "react-responsive"; | |
import { mount } from "enzyme"; | |
import KPICard from "./kpi-card.js"; | |
import Icon from "./icon.js"; | |
import IncomeSolid from "./icome-soild.svg"; | |
const optionsMobile = { | |
wrappingComponent: ResponsiveContext.Provider, |
Global configuration: | |
Username: | |
git config --global user.name "FIRST_NAME LAST_NAME" | |
Email address: | |
git config --global user.email "MY_NAME@example.com" | |
Repository-specific configuration: |
/* | |
(1) Remove duplicate elements from the array | |
arr = [2,2,2,2,2,3,4,4,4,6] | |
returns: [ 2, 3, 4, 6 ] | |
*/ | |
const allDifferentOptions = arr.filter((item, index) => arr.indexOf(item) === index) | |
const allDifferentOptions = [...new Set(arr)] // alternative | |
# Skeleton | |
SELECT | |
FROM | |
WHERE | |
GROUP BY | |
ORDER BY | |
; | |
# use of SELECT - all values |