Skip to content

Instantly share code, notes, and snippets.

Time's precious. Wasting it wisely.

Zara Cooper zaracooper

Time's precious. Wasting it wisely.
View GitHub Profile
zaracooper / WomenStem.js
Last active Dec 24, 2021
Schema for the Women STEM collection in the College Majors Database generated by Cube.js
View WomenStem.js
cube(`WomenStem`, {
sql: `SELECT * FROM \`collegeMajors\`.\`womenStem\``,
preAggregations: {
// Pre-Aggregations definitions go here
// Learn more here:
joins: {
zaracooper /
Created Nov 1, 2021 — forked from rachelandrew/
Template for Smashing Magazine authors

Authors Guide: Article Template

Please submit your article including all of the information below. You can include this as a seperate file if you like - but please complete each section. Please use an online service to write your article, for example Dropbox Paper,, Google Docs. For more help, see the editorial guide

Article Title

Ideally under 67 characters, what problem does this article solve?

Quick Summary

View store-summary.service.ts
import { Injectable } from '@angular/core';
import { Observable, of } from 'rxjs';
import { StoreSummary } from './store-summary';
providedIn: 'root'
export class StoreSummaryService {
getStoreSummary(): Observable<StoreSummary[]> {
zaracooper / store-summary.ts
Created Aug 10, 2020
Store summary interface
View store-summary.ts
export class StoreSummary {
title: string;
value: string;
isIncrease: boolean;
color: string;
percentValue: string;
icon: string;
isCurrency: boolean;
View orders.json
{"id": 242,"date": "2020-06-01","name": "Jennifer Smith","status": "pending","orderTotal": 18,"paymentMode": "cash"},
{"id": 898,"date": "2020-06-02","name": "Jane Jones","status": "shipped","orderTotal": 283,"paymentMode": "paypal"},
{"id": 283,"date": "2020-06-03","name": "Martha Clark","status": "delivered","orderTotal": 493,"paymentMode": "card"},
{"id": 657,"date": "2020-06-04","name": "Wes Bean","status": "pending","orderTotal": 32,"paymentMode": "apple pay"},
{"id": 209,"date": "2020-06-05","name": "James Long","status": "shipped","orderTotal": 34,"paymentMode": "google pay"},
{"id": 178,"date": "2020-06-06","name": "Arthur Black","status": "delivered","orderTotal": 67,"paymentMode": "store credit"},
{"id": 934,"date": "2020-06-07","name": "Paul White","status": "pending","orderTotal": 34,"paymentMode": "cash"},
{"id": 298,"date": "2020-06-08","name": "Alexander Pole","status": "shipped","orderTotal": 209,"paymentMode": "paypal"},
{"id": 382,"date": "2020-06-09","n
View order.ts
export class Order {
id: number;
date: string;
name: string;
status: string;
orderTotal: number;
paymentMode: string;
View sales.json
{"month": "January","revenue": 35763 },
{"month": "February","revenue": 29456},
{"month": "March","revenue": 50782 },
{"month": "April","revenue": 51913 },
{"month": "May","revenue": 26283 },
{"month": "June","revenue": 25478 },
{"month": "July","revenue": 10293 },
{"month": "August","revenue": 26090},
{"month": "September","revenue": 43892 },
View sales.service.ts
import { Injectable } from '@angular/core';
import { HttpClient, HttpErrorResponse } from '@angular/common/http';
import { Observable, throwError } from 'rxjs';
import { catchError } from 'rxjs/operators';
import { MonthlySales } from './monthly-sales';
providedIn: 'root'
zaracooper / mini-card.component.ts
Created Jul 1, 2020
Mini Card Component Class
View mini-card.component.ts
import { Component, Input } from '@angular/core';
selector: 'app-mini-card',
templateUrl: './mini-card.component.html',
styleUrls: ['./mini-card.component.css']
export class MiniCardComponent {
@Input() icon: string;
@Input() title: string;
zaracooper / mini-card.component.css
Created Jul 1, 2020
Styling for the mini card component
View mini-card.component.css
.dashboard-card {
position: absolute;
top: 15px;
left: 15px;
right: 15px;
bottom: 15px;
display: flex;
flex-direction: column;