Skip to content

Instantly share code, notes, and snippets.

View philipszdavido's full-sized avatar

Chidume Nnamdi philipszdavido

View GitHub Profile
@philipszdavido
philipszdavido / class_decorator.ts
Created January 3, 2018 05:53 — forked from remojansen/class_decorator.ts
TypeScript Decorators Examples
function logClass(target: any) {
// save a reference to the original constructor
var original = target;
// a utility function to generate instances of a class
function construct(constructor, args) {
var c : any = function () {
return constructor.apply(this, args);
}

Data Types

Data type Python type Description
DT_FLOAT tf.float32 32 bits floating point.
DT_DOUBLE tf.float64 64 bits floating point.
DT_INT8 tf.int8 8 bits signed integer.
DT_INT16 tf.int16 16 bits signed integer.
DT_INT32 tf.int32 32 bits signed integer.
DT_INT64 tf.int64 64 bits signed integer.

Tensor Shapes

Rank Shape Dimension number Example
0 [] 0-D A 0-D tensor. A scalar.
1 [D0] 1-D A 1-D tensor with shape [5].
2 [D0, D1] 2-D A 2-D tensor with shape [3, 4].
3 [D0, D1, D2] 3-D A 3-D tensor with shape [1, 4, 3].
n [D0, D1, ... Dn-1] n-D A tensor with shape [D0, D1, ... Dn-1].
@philipszdavido
philipszdavido / ngrxintro.md
Created November 17, 2017 21:09 — forked from btroncone/ngrxintro.md
A Comprehensive Introduction to @ngrx/store - Companion to Egghead.io Series

Comprehensive Introduction to @ngrx/store

By: @BTroncone

Also check out my lesson @ngrx/store in 10 minutes on egghead.io!

Update: Non-middleware examples have been updated to ngrx/store v2. More coming soon!

Table of Contents

<?php namespace Console;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
use Console\Command;
/**
* Author: Chidume Nnamdi <kurtwanger40@gmail.com>
*/
<?php namespace Console;
use Symfony\Component\Console\Command\Command as SymfonyCommand;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
/**
* Author: Chidume Nnamdi <kurtwanger40@gmail.com>
*/
import 'core-js'
import * as functions from 'firebase-functions'
import * as admin from 'firebase-admin';
import * as cors from 'cors'
import * as express from 'express'
admin.initializeApp(functions.config().firebase)
var contactsRef: admin.database.Reference = admin.database().ref('/contacts')
exports.addContact = functions.https.onRequest((request: any, response: any) => {
//This file includes polyfills neede by TypeScript when using es2017, es6 or any above es5
// This file is loaded before the app. You can add your own extra polyfills to this file
import 'core-js'
import axios from 'axios'
import chalk from 'chalk'
import * as ora from 'ora'
const url: string = "https://us-central1-myreddit-clone.cloudfunctions.net"
export const addContact = (answers: any) => {
(async () => {
try {
const spinner = ora('Adding contact ...').start();
export let questions: Array<Object> = [
{
type: 'input',
name: 'firstname',
message: 'Enter first name'
},
{
type: 'input',
name: 'lastname',
message: 'Enter Lastname'