Skip to content

Instantly share code, notes, and snippets.

View kylelix7's full-sized avatar
💭
forward is forward

Kyle Li kylelix7

💭
forward is forward
View GitHub Profile
@kylelix7
kylelix7 / convert.sh
Created December 3, 2019 07:27
mp3 to mp4
time ffmpeg -i hocc.mp3 -i IMG_20150621_194231.jpg -c:a copy output2.mp4
import { Injectable } from '@angular/core';
import { HistoricalData } from './models';
import { throwError, Subject } from 'rxjs';
import { catchError } from 'rxjs/operators'
import { HttpClient, HttpErrorResponse } from '@angular/common/http';
@Injectable({
providedIn: 'root'
})
export class StockDataService {
@kylelix7
kylelix7 / updated_chart.ts
Created November 24, 2019 03:48
updated_chart.ts
import { Component, ChangeDetectionStrategy, ChangeDetectorRef } from '@angular/core';
import { StockDataService } from '../stock-data.service';
import { HistoricalData } from '../models';
import { Observable} from 'rxjs';
@Component({
selector: 'app-chart',
templateUrl: './chart.component.html',
styleUrls: ['./chart.component.css'],
changeDetection: ChangeDetectionStrategy.OnPush
@kylelix7
kylelix7 / updated_service.ts
Last active November 24, 2019 03:56
updated_service.ts
import { Injectable } from '@angular/core';
import { HistoricalData } from './models';
import { throwError, Subject } from 'rxjs';
import { catchError } from 'rxjs/operators'
import { HttpClient, HttpErrorResponse } from '@angular/common/http';
@Injectable({
providedIn: 'root'
})
export class StockDataService {
@kylelix7
kylelix7 / app.py
Created November 9, 2019 23:24
app.py
import os
import pandas as pd
from flask import Flask
from flask import abort
from flask import request
from flask_cors import CORS
from flask import jsonify, make_response
app = Flask(__name__, template_folder="templates")
@kylelix7
kylelix7 / serverless.yml
Created November 8, 2019 06:11
serverless.yml
service: stock-backend
plugins:
- serverless-python-requirements
- serverless-wsgi
custom:
wsgi:
app: app.app
packRequirements: false
@kylelix7
kylelix7 / install.sh
Last active November 10, 2019 00:15
install
# Install the serverless cli
npm install -g serverless
# Or, update the serverless cli from a previous version
npm update -g serverless
sls plugin install -n serverless-python-requirements
sls plugin install -n serverless-wsgi
# create python virtual environment and install dependencies
@kylelix7
kylelix7 / app.component.html
Created November 4, 2019 06:30
app.component.html
<app-chart></app-chart>
@kylelix7
kylelix7 / stock-data.service.ts
Last active November 4, 2019 06:26
stock-data.service.ts
import { Injectable } from '@angular/core';
import { HistoricalData } from './models';
import { Subject } from 'rxjs';
@Injectable({
providedIn: 'root'
})
export class StockDataService {
public historicalData: Subject<HistoricalData[]> = new Subject();
constructor() {
@kylelix7
kylelix7 / models.ts
Created November 4, 2019 05:20
models.ts
export interface NameValPair {
'name': string,
'value': number
};
export interface HistoricalData {
'name': string,
'series': NameValPair[]
}