Skip to content

Instantly share code, notes, and snippets.

@ackuser
ackuser / line-chart.component.ts
Created March 2, 2020 19:39
Basic part for in controller for managing the initialisation of the chart in d3 with angular
import { Component, OnInit, ViewChild, ElementRef } from '@angular/core';
import * as d3 from "d3";
@Component({
selector: 'app-line-chart',
templateUrl: './line-chart.component.html',
styleUrls: ['./line-chart.component.scss']
})
export class LineChartComponent implements OnInit {
@ackuser
ackuser / line-chart.component.html
Created March 2, 2020 19:34
Template d3 component
<svg #chart class="chart"></svg>
@ackuser
ackuser / database.module.ts
Created February 3, 2020 18:03 — forked from joseluisq/database.module.ts
Nest Database Module (Type ORM) with environment variables support
import { Module, Global, DynamicModule } from '@nestjs/common'
import { EnvModule } from './env.module'
import { EnvService } from './env.service'
import { TypeOrmModule } from '@nestjs/typeorm'
function DatabaseOrmModule (): DynamicModule {
const config = new EnvService().read()
return TypeOrmModule.forRoot({
type: config.DB_TYPE,
@ackuser
ackuser / multiple-actions.ts
Created January 16, 2020 12:35 — forked from praveenpuglia/multiple-actions.ts
Dispatch multiple actions from ngrx effect
@Effect()
search$: Observable<Action> = this.actions$.pipe(
ofType(SearchActions.SEARCH),
switchMap(action => {
const query = action.payload;
return [new FetchPanel1Data(query), new FetchPanel2Data(query)];
})
);
@ackuser
ackuser / ngrxintro.md
Created January 9, 2020 11:35 — 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

/* MongoDB-UserCollection-Data-Change_Send-Change-SocketIO.js */
'use strict'
module.exports = function (
app,
io,
User // Collection Name
) {
// SET WATCH ON COLLECTION
const changeStream = User.watch();
/* MongoDB-UserCollection-Data-Change_Send-Change-SocketIO.js */
'use strict'
module.exports = function (
app,
io,
User // Collection Name
) {
// SET WATCH ON COLLECTION
const changeStream = User.watch();
@ackuser
ackuser / index.html
Created August 28, 2019 18:55 — forked from chriswhong/index.html
Time block charts wth D3
<!DOCTYPE html>
<html class="html">
<head>
<meta charset="UTF-8">
<title>Document</title>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet">
<style>
.axis text {
font: 10px sans-serif;
@ackuser
ackuser / bar-chart-tooltip.component.ts
Created July 11, 2019 11:50 — forked from AvocadoVenom/bar-chart-tooltip.component.ts
Adding a tooltip to d3 angular component
private tooltip: any; private total: number;
constructor(private service: DataService) {
// ...
this.total = this.dataSource.reduce((sum, it) => sum += it.abs, 0);
}
ngOnInit() {
// ...
this.tooltip = d3.select('#pie') // or d3.select('#bar')
$ cf buildpacks
Getting buildpacks...
buildpack position enabled locked filename
staticfile_buildpack 1 true false staticfile_buildpack-cached-v1.2.1.zip
java_buildpack 2 true false java-buildpack-v3.1.zip
ruby_buildpack 3 true false ruby_buildpack-cached-v1.6.1.zip
nodejs_buildpack 4 true false nodejs_buildpack-cached-v1.5.0.zip
go_buildpack 5 true false go_buildpack-cached-v1.5.0.zip
python_buildpack 6 true false python_buildpack-cached-v1.5.0.zip