Skip to content

Instantly share code, notes, and snippets.

View peterblazejewicz's full-sized avatar
:octocat:
@code #remote #ssh #raspberrypi

Piotr Błażejewicz (Peter Blazejewicz) peterblazejewicz

:octocat:
@code #remote #ssh #raspberrypi
View GitHub Profile
@peterblazejewicz
peterblazejewicz / input.scss
Created May 21, 2023 16:14
Generated by SassMeister.com.
$primary: #334455;
.card {
--primary-color: $primary;
}
.card {
--primary-color: #{$primary};
}
@peterblazejewicz
peterblazejewicz / launch.json
Created October 21, 2022 06:27
Angular VSCode integration
{
"version": "0.2.0",
"configurations": [
{
"name": "ng serve",
"type": "msedge",
"request": "launch",
"preLaunchTask": "npm: start",
"url": "http://localhost:4200/"
},
interface ApiData {
'maps:longitude': string;
'maps:latitude': string;
}
type RemoveMapsFromData<T> = {
[K in keyof T as RemoveMaps<K>]: T[K];
};
type ExpectedApiData = RemoveMapsFromData<ApiData>;
@peterblazejewicz
peterblazejewicz / gist:31433e01b4bb39c33ee0a10b45ec0677
Created June 21, 2022 19:17
🎉 Congratulations! You are eligible to use GitHub Copilot for free.
🎉 Congratulations! You are eligible to use GitHub Copilot for free.
type DeepPartial<Thing> = Thing extends Function
? Thing
: Thing extends Array<infer InferredArrayMembmer>
? Array<DeepPartial<Thing>>
: Thing extends object
? DeepPartialObject<Thing>
: Thing | undefined;
type DeepPartialObject<Thing> = {
[Key in keyof Thing]?: DeepPartial<Thing[Key]>;
@peterblazejewicz
peterblazejewicz / branch-cleanup.ps1
Created March 31, 2022 06:54
git branch delete all but main powershell Win OS
git for-each-ref --format '%(refname:short)' refs/heads | ForEach-Object {If($_.StartsWith("main") -eq $false) { git branch -D $_ }}
@peterblazejewicz
peterblazejewicz / index.d.ts
Created February 14, 2022 17:32
Smooch sample
// Type definitions for smooch 5.3
// Project: https://github.com/zendesk/sunshine-conversations-web
// Definitions by: Jordan Sorensen <https://github.com/jpsorensen>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare namespace Smooch {
/**
* Initializes the Smooch widget in the web page using the specified options. It returns a promise that will resolve when the Web Messenger is ready. Note that except on and off, all methods needs
* to be called after a successful init.
*/
@peterblazejewicz
peterblazejewicz / 0001-pr-review.patch
Created January 5, 2022 22:05
0001-pr-review.patch
From df02cbd00bebd0b2ae77302c35ffe8fef47a7343 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Piotr=20B=C5=82a=C5=BCejewicz?=
<[email protected]>
Date: Wed, 5 Jan 2022 22:57:18 +0100
Subject: [PATCH] pr review
---
types/async-busboy/async-busboy-tests.ts | 2 +-
types/async-busboy/tsconfig.json | 5 +
types/busboy/busboy-tests.ts | 369 ++++++++++-------------
@peterblazejewicz
peterblazejewicz / app.module.ts
Created December 17, 2021 12:11
Upgrading services (angularjs > angular):
import { HttpClientModule } from '@angular/common/http';
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { downgradeInjectable, UpgradeModule } from '@angular/upgrade/static';
import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component';
import { CheckmarkPipe } from './checkmark/checkmark.pipe';
import { PhoneDetailContainerComponent } from './phone-detail/phone-detail-container.component';
import { PhoneDetailDirective } from './phone-detail/phone-detail.directive';
@peterblazejewicz
peterblazejewicz / gist:5fb03692df0be11202873eb9672d39d6
Created December 16, 2021 21:21
git remove all branches except master (powershell editon)
git branch | %{ $_.Trim() } | ?{ $_ -ne 'master' } | %{ git branch -D $_ }