Skip to content

Instantly share code, notes, and snippets.

@ackuser
ackuser / fix-dyld-missing-symbol-called-errors-on-m1-macs.md
Created May 12, 2023 07:19 — forked from adrienjoly/fix-dyld-missing-symbol-called-errors-on-m1-macs.md
Fix `dyld[]: missing symbol called` errors when running Node.js programs on M1 Macs

Problem

If you're getting this kind of error when running Node.js programs with binary dependencies that don't support M1 yet, e.g.:

$ yarn test
dyld[51175]: missing symbol called
dyld[51176]: missing symbol called
@ackuser
ackuser / paginated.interface.ts
Created May 3, 2023 09:22 — forked from tugascript/paginated.interface.ts
A Generic Paginated Type for GraphQL in NestJS code first approach
export interface IEdge<T> {
cursor: string;
node: T;
}
interface IPageInfo {
endCursor: string;
hasNextPage: boolean;
}
@ackuser
ackuser / security.conf
Created April 17, 2023 08:15 — forked from ambroisemaupate/security.conf
Nginx CSP example
# config to don't allow the browser to render the page inside an frame or iframe
# and avoid clickjacking http://en.wikipedia.org/wiki/Clickjacking
# if you need to allow [i]frames, you can use SAMEORIGIN or even set an uri with ALLOW-FROM uri
# https://developer.mozilla.org/en-US/docs/HTTP/X-Frame-Options
add_header X-Frame-Options SAMEORIGIN;
# when serving user-supplied content, include a X-Content-Type-Options: nosniff header along with the Content-Type: header,
# to disable content-type sniffing on some browsers.
# https://www.owasp.org/index.php/List_of_useful_HTTP_headers
# currently suppoorted in IE > 8 http://blogs.msdn.com/b/ie/archive/2008/09/02/ie8-security-part-vi-beta-2-update.aspx
@ackuser
ackuser / .block
Created March 17, 2023 10:37 — forked from mbostock/.block
Brush & Zoom
license: gpl-3.0
redirect: https://observablehq.com/@d3/focus-context
@ackuser
ackuser / .block
Created March 6, 2023 16:04 — forked from d3noob/.block
v7 curve interpolation comparison
license: mit
@ackuser
ackuser / svg-rounded-rectangle-path.js
Created March 3, 2023 05:24 — forked from danielpquinn/svg-rounded-rectangle-path.js
Draw SVG Rounded Rectangle Path
/**
* Get path data for a rounded rectangle. Allows for different radius on each corner.
* @param {Number} w Width of rounded rectangle
* @param {Number} h Height of rounded rectangle
* @param {Number} tlr Top left corner radius
* @param {Number} trr Top right corner radius
* @param {Number} brr Bottom right corner radius
* @param {Number} blr Bottom left corner radius
* @return {String} Rounded rectangle SVG path data
*/
@ackuser
ackuser / README.md
Created January 17, 2023 16:34 — forked from rveciana/README.md
conicConformalSpain example

This file shows how to use the geoConicConformalSpain projection from d3-composite-projections.

To change the file, edit draw.js and run

browserify draw.js| uglifyjs > bundle.js

The dependencies are installed with:

npm install d3-composite-projections d3-geo d3-request d3-selection d3-transition topojson

h scroll left
j scroll down
k scroll up
l scroll right
gg scroll to top of the page
G scroll to bottom of the page
f activate link hints mode to open in current tab
F activate link hints mode to open in new tab
r reload
import { Component, OnInit } from '@angular/core';
import { AbstractControl, FormBuilder, FormControl, ValidationErrors, ValidatorFn, Validators } from '@angular/forms';
import { Observable, withLatestFrom } from 'rxjs';
import { Web3Service } from '../web3.service';
@Component({
selector: 'app-login',
templateUrl: './login.component.html',
styleUrls: ['./login.component.scss']
})
import { Injectable } from '@angular/core';
import { hdkey } from "ethereumjs-wallet";
import * as bip39 from "bip39";
import Web3 from 'web3'
import * as Mnemonic from "bitcore-mnemonic";
import * as CryptoJS from "crypto-js";
import { of } from 'rxjs';
@Injectable({
providedIn: 'root'