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 / 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?=
<peterblazejewicz@users.noreply.github.com>
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 $_ }
@peterblazejewicz
peterblazejewicz / template-resolver.ts
Created December 16, 2021 16:07
Template resolver (angularjs to angular) example
@Injectable()
export class TemplateResolver implements Resolve<string> {
constructor(
private templateService: TemplateService,
@Inject('$templateCache') private $templateCache: any
) {}
resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot) {
const templateUrl = route.data.templateUrl;
return this.templateService
.getTemplate(templateUrl)
@peterblazejewicz
peterblazejewicz / diff.diff
Created November 4, 2021 20:24
Formidable v1/v2
diff --git a/types/formidable/formidable-tests.ts b/types/formidable/formidable-tests.ts
index c70026e202..91b8449071 100644
--- a/types/formidable/formidable-tests.ts
+++ b/types/formidable/formidable-tests.ts
@@ -1,6 +1,7 @@
import formidable = require("formidable");
import {
defaultOptions,
+ enabledPlugins,
plugins,
@peterblazejewicz
peterblazejewicz / index.d.ts
Created October 12, 2021 18:29
types/mdx/index.d.ts
// Type definitions for non-npm package mdx 2.0
// Project: https://github.com/mdx-js/mdx
// Definitions by: Christian Murphy <https://github.com/ChristianMurphy>
// Remco Haszing <https://github.com/remcohaszing>
// Titus Wormer <https://github.com/wooorm>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 3.9
type FunctionComponent<Props> = (props: Props) => JSX.Element;
type ClassComponent<Props> = new (props: Props) => JSX.ElementClass;
@peterblazejewicz
peterblazejewicz / libmime.d.ts
Created September 10, 2021 06:50
libmime.d.ts
export class Libmime {
constructor(config: any);
config: any;
/**
* Checks if a value is plaintext string (uses only printable 7bit chars)
*
* @param {String} value String to be tested
* @returns {Boolean} true if it is a plaintext string
*/
isPlainText(value: string): boolean;
@peterblazejewicz
peterblazejewicz / gitflow-breakdown.md
Created November 19, 2020 20:31 — forked from JamesMGreene/gitflow-breakdown.md
A comparison of using `git flow` commands versus raw `git` commands.

Initialize

gitflow git
git flow init git init
  git commit --allow-empty -m "Initial commit"
  git checkout -b develop master

Connect to the remote repository

@peterblazejewicz
peterblazejewicz / sample.py
Created April 19, 2020 14:55
asyncio.Queue to process SenseHat keyboard events in asynchronous event loop
#!/usr/bin/python
import asyncio
from sense_hat import SenseHat
sense: SenseHat = None
loop: asyncio.AbstractEventLoop = None
queue: asyncio.Queue = None
def process_direction(event):
@peterblazejewicz
peterblazejewicz / skills-ts-pluralsight.md
Created March 14, 2020 12:59
skills-ts-pluralsight.md

image