Skip to content

Instantly share code, notes, and snippets.

View johnpapa's full-sized avatar
💭
🐺Winter is coming

John Papa johnpapa

💭
🐺Winter is coming
View GitHub Profile
@johnpapa
johnpapa / admin.component.spec.ts
Last active March 11, 2017 15:51
Starting point before tests in an Angular component with router-outlet
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { RouterTestingModule } from '@angular/router/testing';
import { NO_ERRORS_SCHEMA } from '@angular/core';
import { AdminComponent } from './admin.component';
import { routes } from './admin-routing.module';
import { EmailBlastComponent } from './email-blast/email-blast.component';
import { UsersComponent } from './users/users.component';
describe('AdminComponent', () => {
@johnpapa
johnpapa / character-detail.component.spec.ts
Last active June 8, 2021 10:27
Angular Input Host/Child Component Test
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { Component, NO_ERRORS_SCHEMA, DebugElement } from '@angular/core';
import { By } from '@angular/platform-browser';
import { CharacterDetailComponent } from './character-detail.component';
import { Character, DataService } from '../../core';
import * as testing from '../../../testing';
@Component({
template: '<ro-character-detail [character]="selectedCharacter"></ro-character-detail>'
@johnpapa
johnpapa / .eslintrc.json
Created July 7, 2017 14:00
.eslintrc.json
{
"env": {
"browser": true,
"commonjs": true,
"es6": true,
"node": true
},
"parserOptions": {
"ecmaFeatures": {
"jsx": true
@johnpapa
johnpapa / .bash_profile
Last active January 23, 2020 10:07
simple git prompt
function parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
export PS1="\u @ \w$\[\033[32m\]\$(parse_git_branch)\[\033[00m\] \n$ "
@johnpapa
johnpapa / DockerCleanupScripts.md
Created August 3, 2017 01:37 — forked from spboyer/DockerCleanupScripts.md
Docker Cleanup Scripts

Docker - How to cleanup (unused) resources

Cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see: https://github.com/chadoe/docker-cleanup-volumes

$ docker volume rm $(docker volume ls -qf dangling=true)

$ docker volume ls -qf dangling=true | xargs -r docker volume rm

@johnpapa
johnpapa / Dockerfile
Created August 21, 2017 19:52
Docker with angular and node
# clone the code
git clone
# build the docker image locally
docker build -t angular-cosmosdb-app .
# show the image
docker images
# run it locally
@johnpapa
johnpapa / .eslintrc.json
Created September 16, 2017 18:04
.eslintrc
{
"env": {
"browser": true,
"commonjs": true,
"es6": true,
"node": true
},
"parserOptions": {
"ecmaFeatures": {
"jsx": true
@johnpapa
johnpapa / .angular-cli.schema.json
Created November 21, 2017 14:11
Angular CLI Config Schema
{
"$schema": "http://json-schema.org/schema",
"id": "https://github.com/angular/angular-cli/blob/master/packages/@angular/cli/lib/config/schema.json#CliConfig",
"title": "Angular CLI Config Schema",
"type": "object",
"properties": {
"$schema": {
"type": "string"
},
"project": {
@johnpapa
johnpapa / doc.md
Created August 9, 2018 21:16
cosmos api doc

title: Node.js tutorial for the SQL API for Azure Cosmos DB | Microsoft Docs description: A Node.js tutorial that demonstrates how to connect to and query Azure Cosmos DB using the SQL API keywords: node.js tutorial, node database services: cosmos-db author: deborahc manager: andrl editor: monicar

ms.service: cosmos-db

@johnpapa
johnpapa / zeroconfig.sh
Created September 20, 2018 01:22
zero config vue app
npm install -g @vue/cli-service-global
echo '<template><h1>Hello!</h1></template>' > App.vue
vue serve