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 getTwoColIndexByHorizontalRendering = switchCase<string, number | null>({ | |
'2 Column - 1 Column': 0, | |
'1 Column - 2 Column': 1, | |
})(null); | |
// Examples | |
getTwoColIndexByHorizontalRendering('2 Column - 1 Column'); // returns 0 | |
getTwoColIndexByHorizontalRendering('1 Column - 2 Column'); // returns 1 | |
getTwoColIndexByHorizontalRendering('unknown layout'); // returns null |
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 { Component } from '@angular/core'; | |
import { MyService } from './my-service.service'; | |
export interface Item { | |
price: number; | |
name: string; | |
quantitiy: number; | |
} | |
export interface Groceries { |
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
#coding: utf-8 | |
import imaplib | |
import sys | |
''' | |
Simple script that delete emails from a given sender | |
params: | |
-username: Gmail username | |
-pw: gmail pw | |
-label: If you have a label that holds the emails, specify here |
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 { Component, Input } from '@angular/core'; | |
import { FormGroup } from '@angular/forms'; | |
@Component({ | |
selector: 'app-child', | |
template: ` | |
<h1>Enter your name</h1> | |
<form | |
[formGroup]="nameForm" | |
(ngSubmit)="submitForm(nameForm)" |
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 { async, ComponentFixture, TestBed } from '@angular/core/testing'; | |
import { ReactiveFormsModule, FormBuilder } from '@angular/forms'; | |
import { CommonModule } from '@angular/common'; | |
import { AppModule } from './app.module'; | |
import { ChildComponent } from './child.component'; | |
describe('StaticComponent', () => { | |
let component: StaticComponent; | |
let fixture: ComponentFixture<ChildComponent>; |
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 { async, ComponentFixture, TestBed } from '@angular/core/testing'; | |
import { ReactiveFormsModule, FormBuilder } from '@angular/forms'; | |
import { CommonModule } from '@angular/common'; | |
import { AppModule } from './app.module'; | |
import { ChildComponent } from './child.component'; | |
describe('StaticComponent', () => { | |
let component: StaticComponent; | |
let fixture: ComponentFixture<ChildComponent>; |
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
# skips repeat keywords and URL's | |
index = [] | |
def find(keyword, index): | |
for i, item in enumerate(index): | |
try: | |
r = item.index(keyword) | |
except ValueError: | |
continue |