- Read How to answer a coding interview.
- Read Using sliding window technique to solve coding interview questions.
- Practice coding Array 1 Two Sum
- Practice coding Array 2 Three Sum
- Practice coding Array 3 Max Consecutive Ones III
- Practice coding Array 4 Maximum Product Subarray
This file contains hidden or 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
function getCardType(cardNum) { | |
if(!luhnCheck(cardNum)){ | |
return ""; | |
} | |
var payCardType = ""; | |
var regexMap = [ | |
{regEx: /^4[0-9]{5}/ig,cardType: "VISA"}, | |
{regEx: /^5[1-5][0-9]{4}/ig,cardType: "MASTERCARD"}, | |
{regEx: /^3[47][0-9]{3}/ig,cardType: "AMEX"}, |
This file contains hidden or 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 { Injectable } from '@angular/core'; | |
import { CanActivate, Router } from '@angular/router'; | |
import { FirebaseAuth, FirebaseAuthState } from 'angularfire2'; | |
import { Observable } from 'rxjs/Observable'; | |
@Injectable() | |
export class AuthGuard implements CanActivate { | |
constructor(private auth: FirebaseAuth, private router: Router) { } |
This file contains hidden or 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
There is no way to store an empty object/array/null value. | |
There are also no actual arrays. Array values get stored as objects with integer keys. | |
(If all keys are integers, it will be returned as an array.) | |
Basically, it's one giant tree of hashes with string keys. | |
Simply write a value to any location, and the intermediary locations will automatically come into existance. | |
── Classes ── | |
DataSnapshot : Container for a subtree of data at a particular location. |
This file contains hidden or 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, OnInit, OnDestroy } from '@angular/core'; | |
import {Http} from "@angular/http"; | |
import { LocalCacheService } from "./local-cache.service"; | |
@Component({ | |
selector: 'app-example', | |
templateUrl: './app.component.html', | |
styleUrls: ['./app.component.scss'] | |
}) | |
export class ExampleComponent implements OnInit, OnDestroy { |
This file contains hidden or 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 math | |
ICO_SUPPLY = 10**9 | |
DECIMALS = 8 | |
FLOAT_FACTOR = 10**DECIMALS | |
IMUSIFY_OPERATION_STACK = (3-1) * ICO_SUPPLY * FLOAT_FACTOR | |
SOME_USER_ADDRESS = 'ASsudg...poor soul' | |
IMUSIFY_MAIN_IMU_ADDRESS = "AXjsdb...much IMU here" | |
IMUSIFY_OPERATION_IMU_ADDRESS = "AKjsdb...less IMU here" |
This file contains hidden or 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 { ModuleMetadata, Type } from '@nestjs/common/interfaces' | |
/** | |
* Options that ultimately need to be provided to create a MongoDB connection | |
*/ | |
export interface MongoModuleOptions { | |
connectionName?: string | |
uri: string | |
dbName: string | |
clientOptions?: any |
This file contains hidden or 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 { ModuleMetadata, Type } from '@nestjs/common/interfaces' | |
/** | |
* Options that ultimately need to be provided to create a MongoDB connection | |
*/ | |
export interface MongoModuleOptions { | |
connectionName?: string | |
uri: string | |
dbName: string | |
clientOptions?: any |
Hey Apple users:
If you're now experiencing hangs launching apps on the Mac, I figured out the problem using Little Snitch.
It's trustd connecting to http://ocsp.apple.com >
OlderNewer