Skip to content

Instantly share code, notes, and snippets.

@ackuser
ackuser / _gradients.css.scss
Created March 25, 2019 16:05 — forked from thbar/_gradients.css.scss
SCSS mixing for CSS3 gradients
@mixin gradient($from, $to) {
/* fallback/image non-cover color */
background-color: $from;
/* Firefox 3.6+ */
background-image: -moz-linear-gradient($from, $to);
/* Safari 4+, Chrome 1+ */
background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, from($from), to($to));
import { Module } from '@nestjs/common';
import { TypeOrmModule } from '@nestjs/typeorm';
import { DatabaseModule } from 'modules/database/database.module';
import { User } from 'modules/shared/entities/user.entity';
import { UserService } from './services/user.service';
@Module({
imports: [DatabaseModule, TypeOrmModule.forFeature([User], Config.get.databases.main.name)],
exports: [DatabaseModule, UserService],
providers: [UserService]
@ackuser
ackuser / ResponsiveService.js
Created April 18, 2019 08:35 — forked from snewell92/ResponsiveService.js
Angular Responsive Service
/* TYPESCRIPT */
import { Injectable } from '@angular/core';
@Injectable()
export class ResponsiveService {
constructor() {
window.onresize = this.callSubscribers
}
$ 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
@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')
@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;
/* 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 / 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

@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)];
})
);