Skip to content

Instantly share code, notes, and snippets.

@ackuser
ackuser / homebrew-permissions-issue.md
Created September 28, 2020 12:05 — forked from irazasyed/homebrew-permissions-issue.md
Homebrew: Permissions Denied Issue Fix (OS X / macOS)

Homebrew Permissions Denied Issues Solution

sudo chown -R $(whoami) $(brew --prefix)/*

@ackuser
ackuser / .block
Created September 2, 2020 17:16 — forked from mbostock/.block
Bar Chart with Negative Values
license: gpl-3.0
redirect: https://observablehq.com/@d3/diverging-bar-chart
@ackuser
ackuser / dropshadow.js
Created August 28, 2020 08:05 — forked from cpbotha/dropshadow.js
d3.js drop shadow example
// d3.js drop shadow example
// put together by http://charlbotha.com/
var items = [
{x : 50, y : 10},
{x : 100, y: 170},
{x : 320, y: 70}
];
// we can increase this, everything will scale up with us
export function logger( reducer ) {
return function newReducer( state, action ) {
console.group(action.type);
const nextState = reducer(currentState, action);
console.log(`%c prev state`, `color: #9E9E9E; font-weight: bold`, state);
console.log(`%c action`, `color: #03A9F4; font-weight: bold`, action);
console.log(`%c next state`, `color: #4CAF50; font-weight: bold`, nextState);
console.groupEnd();
return nextState;
}
@ackuser
ackuser / nativeJavaScript.js
Created June 9, 2020 07:05 — forked from alexhawkins/nativeJavaScript.js
Implementation of Native JavaScript Methods (forEach, Map, Filter, Reduce, Every, Some)
'use strict';
/*****************NATIVE forEACH*********************/
Array.prototype.myEach = function(callback) {
for (var i = 0; i < this.length; i++)
callback(this[i], i, this);
};
//tests

I’m looking forward to the Sass Fundamentals workshop! A few notes to ensure you’re set up in advance are below.

See you soon!

Mike

Node.js

You’ll need a relatively recent version (v4.5 or newer, v7 ideally) of node.js installed. On OS X, a great way of doing this without disturbing your existing dev environment is to install NVM. Installation instructions are here.

@ackuser
ackuser / line-chart.component.scss
Created March 3, 2020 18:26
Style of angular d3 visual line chart component
/* 13. Basic Styling with CSS */
/* Style the lines by removing the fill and applying a stroke */
::ng-deep .line {
fill: none;
stroke: #ffab00;
stroke-width: 3;
}
::ng-deep .overlay {
@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,