Skip to content

Instantly share code, notes, and snippets.

View EileenJuergens's full-sized avatar
🎯
Focusing

Eileen Jürgens EileenJuergens

🎯
Focusing
View GitHub Profile
@EileenJuergens
EileenJuergens / git-commands
Last active February 23, 2021 13:41
Git commands
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
@EileenJuergens
EileenJuergens / Postgres
Created September 22, 2019 17:57
Postgres
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
@EileenJuergens
EileenJuergens / postgres-brew.md
Created May 2, 2020 11:49 — forked from ibraheem4/postgres-brew.md
Installing Postgres via Brew (OSX)

Installing Postgres via Brew

Pre-Reqs

Brew Package Manager

In your command-line run the following commands:

  1. brew doctor
  2. brew update
@EileenJuergens
EileenJuergens / kpi-card.js
Last active March 1, 2021 11:06
KPI Card Logic
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">
@EileenJuergens
EileenJuergens / kpi-card.scss
Created February 26, 2021 11:30
KPI Card CSS
.kpi-card {
flex: 0 0 100%;
max-width: 100%;
padding: 8px;
@include bp-medium {
flex-basis: 0;
flex-grow: 1;
max-width: 100%;
}
}
@EileenJuergens
EileenJuergens / kpi-card-content.test.js
Last active March 1, 2021 10:24
KPi Card test content
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,
@EileenJuergens
EileenJuergens / gist:7beee54be859fe87753b0affbd0059f1
Last active April 26, 2021 14:30
GitHub account configuration
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:
@EileenJuergens
EileenJuergens / helpers.js
Created April 29, 2021 09:26
JS helper functions and methods
/*
(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
@EileenJuergens
EileenJuergens / helpers.sql
Last active July 26, 2021 14:11
SQL notes
# Skeleton
SELECT
FROM
WHERE
GROUP BY
ORDER BY
;
# use of SELECT - all values