Skip to content

Instantly share code, notes, and snippets.

View gparlakov's full-sized avatar

Georgi Parlakov gparlakov

  • Sofia, Bulgaria
View GitHub Profile
@gparlakov
gparlakov / launch-debug-all.json
Created February 19, 2019 12:56
Debug all jest tests
{
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Debug Jest all tests",
"program": "${workspaceFolder}\\node_modules\\jest\\bin\\jest",
"//comment":"--runInBand allows the 'debugger' and breakpoints to be hit --verbosity false due to bug where console.log is not seen on the console",
"args": ["--runInBand", "--verbose", "false"],
"cwd": "${workspaceFolder}"
@gparlakov
gparlakov / settings.json
Last active February 19, 2019 15:39
Instruct VS Code to give you only "your" intellisense stuff
{
"editor.quickSuggestions": {
"other": false,
"comments": false,
"strings": false
},
"editor.suggest.localityBonus": true,
}
@gparlakov
gparlakov / components.ts
Last active March 10, 2019 13:22
Two angular components using the same class name for style
@Component({
selector: "gp-button1",
template: `
<p class="button">
button1 works!
</p>
`,
styles: [".button { background-color: green; color: white}"],
encapsulation: ViewEncapsulation.Emulated // the default
})
import { Component, ViewEncapsulation } from '@angular/core';
@Component({
selector: "gp-button2",
template: `
<button class="button" (click)="onToggleDialogClick()">
Show dialog
</button>
<p-dialog header="Title" [(visible)]="visible">
This is the dialog content
import { Component, ViewEncapsulation } from '@angular/core';
@Component({
selector: "gp-button2",
template: `
<button class="button" (click)="onToggleDialogClick()">
Show dialog
</button>
<p-dialog header="Title" [(visible)]="visible">
This is the dialog content
<my-app _nghost-c3="" ng-version="7.2.8">
<gp-button2 _ngcontent-c3="" _nghost-c4="">
<button _ngcontent-c4="" class="button"> Show dialog </button>
<p-dialog _ngcontent-c4="">
..skip for brevity
</p-dialog>
</gp-button2>
</my-app>
setTimeout(() => console.log('immediate timeout'), 0)
new Promise(res => res('immediate promise')).then(console.log)
console.log('after all');
// logs
// 'after all'
// 'immediate promise'
// 'immediate timeout'
export class WalletService {
createWallet() {
const ethers = System.import(/* webpackChunkName: 'bip39_ethers' */'ethers');
const bip39 = System.import(/* webpackChunkName: 'bip39_ethers' */'bip39');
}
}
// resulting in webpack splitting bip39_ethers.chunk.js
// and only loading it when a user needs to create a wallet
FROM mcr.microsoft.com/dotnet/core/sdk:2.2
# Install Node.js LTS
RUN curl -sL https://deb.nodesource.com/setup_8.x | bash -
RUN apt-get install -y nodejs
# need gulp as a globally available cli tool
RUN npm -g install gulp
# install packages (and cache until package json changed)
WORKDIR /build/Web-App/AllReady