Monday, 9 October 2023

Ukrycie niepotrzebnych danych w karcie SSMS


Aby ukryć niepotrzebne informacje w nazwach tabów w SQL Server Management Studio, wybierz Tools -> Options ->Text editor -> Tab Text.

Na liście zaznacz "False" przy: "Include database name" i "Include login name".

Otwarte karty nie zmienią swoich tytułów, ale nowe karty już będą miały krótki opis.


Thursday, 28 September 2023

Wyświetlenie hasła WiFi

netsh wlan show profile

Pokazuje listę zapisanych profili. Np. chcę sprawdzić hasło dla sieci "biuro".

netsh wlan show profile name="biuro" key=clear

Szukam sekcji "Security settings" i wiersza "Key Content".

Thursday, 6 July 2023

Host Angular in Firebase

1. Create project in Firebase. Create Angular application

2. Install firebase tools

npm install -g firebase-tools

3. Login and Initialize Firebase in Angular project

firebase login

firebase init hosting

4. Build Angular

ng build

5. Deploy built folder

firebase deploy

Monday, 22 May 2023

Storybook - Cannot read property 'split' of undefined

I had this error when added MDX documentation to a story:

 

Uncaught TypeError: Cannot read property 'split' of undefined

    at parseKind (index.js:90)

    at defaultTitleSlot (Title.js:46)

    at Title (Title.js:71)

    at renderWithHooks (react-dom.development.js:14803)

    at mountIndeterminateComponent (react-dom.development.js:17482)

    at beginWork (react-dom.development.js:18596)

    at HTMLUnknownElement.callCallback (react-dom.development.js:188)

    at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask (zone.js:421)

    at Zone.push../node_modules/zone.js/dist/zone.js.Zone.runTask (zone.js:188)

    at ZoneTask.push../node_modules/zone.js/dist/zone.js.ZoneTask.invokeTask [as invoke] (zone.js:503)

 

Story:

 

import doc from './controls.mdx';

 

export default {

  title: 'Controls',

  parameters: {

    docs: {

      page: doc

    }

  },

  decorators: [

    moduleMetadata({

      declarations: [FooBarComponent],

      imports: [NgbModuleClickOutsideModule]

    }),

    withPreview

  ]

};

 

export const TooltipClick = () => ({

  component: FooBarComponent,

  template: statusProcessTemplate

});

TooltipClick.story = {

  name: 'Process status',

  parameters: { preview: [{ tab: 'HTML'language: 'html'template: statusProcessTemplate }] }

};

 

I don't know why, but I removed the line:

component: FooBarComponent,

and then documentation started working again.

 

Sunday, 26 March 2023

Dodanie nowego komponentu - app.module.ts


  1. import { YourNameComponent } from './pages/admin/YourName/YourName.component';

  2. appRoutes: Routes = [
    {
    path: 'admin/YourName',
    component: YourNameComponent,
    canActivate: [AuthenticationGuard],
    data: { title: 'Your Name', isNew: true }
    },

  3. @NgModule({
      declarations: [
        YourNameComponent

Saturday, 25 March 2023

Preparing Dev Env for Angular

Install software
1. Install Visual Studio Code
2. Install Git
3. Install Node.js

Configure Angular with NPM (node package manager)

1. install Angular CLI - use command prompt or VS Code terminal
npm install -g @angular/cli
2. install SASS
npm install -g node-sass
3. To create new Angular project with SASS as default style:
ng new project-name-here --style=scss
4. To create new Angular component:
ng generate component name-here

Monday, 2 January 2023

Show active file in Solution Explorer

 Tools > Options > Projects and Solutions > General > Track Active Item in Solution Explorer

Thursday, 25 August 2022

Using process.env in React

  1. Install dotenv package
  2. Create .env file in root directory
  3. Add variables to the file like this:
REACT_APP_MOCK_API_URL=data1
REACT_APP_REST_KEY=data2

  1. Read variables like this:

const key = process.env.REACT_APP_REST_KEY;
const mockUrl = process.env.REACT_APP_MOCK_API_URL;

Important!

Variable name MUST begin with "REACT_APP_"

(Initially I called variable MOCK_API_URL. It took me few hours to figure out why key contained value and mockUrl was undefined.)


Tuesday, 17 May 2022

Zestawienie prepaid

Znalazłem "magiczny excel" zawierający porównanie pakietów "na kartę" we wszystkich polskich telekomach: https://drive.google.com/file/d/1wTRENPirHx9ZgyKj4oeKP2A-eaSYKn-e/view 

Gdyby plik został jednak usunięty, na MEGA jest pobrana aktualna (na moment opublikowania tego wpisu) wersja: https://bit.ly/3sG7mwQ

Friday, 11 February 2022

Jak usunąć pliki z poprzedniej instalacji Windows, do których nie ma dostępu

takeown /F "D:\Program Files" /A /R /D Y
icacls "D:\Program Files" /T /grant administrators:F
rd /s /q "D:\Program Files"