Skip to content

Instantly share code, notes, and snippets.

View PhilippMeissner's full-sized avatar
🏠
Working from home

Philipp Meißner PhilippMeissner

🏠
Working from home
View GitHub Profile
@PhilippMeissner
PhilippMeissner / coinflip_odds.js
Created July 1, 2022 19:20
Coinflip calculator
const HEADS = 'heads';
const TAILS = 'tails';
const DESIRED_STREAK_COUNT = 10;
const DESIRED_RESULT = HEADS;
function start() {
let attempts = 1;
let totalFlips = 0;
let streakCount = 0;
let done = false;
@PhilippMeissner
PhilippMeissner / Viewport.tsx
Last active December 4, 2021 18:05
React component showing active tailwind viewport
const Viewport = () => {
return (
<span className={"absolute top-4 right-4"}>
<pre className="sm:hidden">base</pre>
<pre className="hidden sm:block md:hidden">sm</pre>
<pre className="hidden md:block lg:hidden">md</pre>
<pre className="hidden lg:block xl:hidden">lg</pre>
<pre className="hidden xl:block 2xl:hidden">xl</pre>
<pre className="hidden 2xl:block">2xl</pre>
</span>
@PhilippMeissner
PhilippMeissner / gist:fd4c15ad8b6cea7828c93a740a841ed7
Created January 22, 2021 10:31
Angular force app update and block view until then
index.html
```
<script>
body > .splash > .spinner {
width: 50px;
height: 50px;
margin: 100px auto;
background-color: #676767;
border-radius: 100%;
-webkit-animation: sk-scaleout 1.0s infinite ease-in-out;
@PhilippMeissner
PhilippMeissner / angular.json
Created February 25, 2020 12:40
angular.json
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"version": 1,
"newProjectRoot": "projects",
"projects": {
"XX-frontend": {
"root": "",
"sourceRoot": "src",
"projectType": "application",
"prefix": "XX",
@PhilippMeissner
PhilippMeissner / gist:ac901fae1022c46859fe08b01b41c5fa
Created February 25, 2020 12:36
Out of locally working build
yarn install v1.22.0
[1/5] 🔍 Validating package.json...
[2/5] 🔍 Resolving packages...
[3/5] 🚚 Fetching packages...
[4/5] 🔗 Linking dependencies...
warning " > @angular/http@7.2.16" has incorrect peer dependency "@angular/core@7.2.16".
warning " > @angular/http@7.2.16" has incorrect peer dependency "@angular/platform-browser@7.2.16".
warning " > @ngrx/effects@8.6.0" has incorrect peer dependency "@angular/core@^8.0.0".
warning " > @ngrx/router-store@8.6.0" has incorrect peer dependency "@angular/common@^8.0.0".
warning " > @ngrx/router-store@8.6.0" has incorrect peer dependency "@angular/core@^8.0.0".
@PhilippMeissner
PhilippMeissner / gist:4a719870ac1dfb91776e4d728c528e69
Created February 25, 2020 12:33
Output which displays hanging before command
-----> Apt app detected
-----> Detected Aptfile or Stack changes, flushing cache
-----> Adding custom repositories
-----> Updating apt caches
Get:1 http://archive.ubuntu.com/ubuntu bionic InRelease [242 kB]
Get:2 http://apt.postgresql.org/pub/repos/apt bionic-pgdg InRelease [46.3 kB]
Get:3 http://archive.ubuntu.com/ubuntu bionic-security InRelease [88.7 kB]
Get:4 http://archive.ubuntu.com/ubuntu bionic-updates InRelease [88.7 kB]
Get:5 http://archive.ubuntu.com/ubuntu bionic/main amd64 Packages [1,344 kB]
Get:6 http://apt.postgresql.org/pub/repos/apt bionic-pgdg/main amd64 Packages [293 kB]
@PhilippMeissner
PhilippMeissner / gist:21e387c544873c4381e74d56338c5c1b
Created February 25, 2020 12:32
Output which displays hanging after command
-----> Apt app detected
-----> Detected Aptfile or Stack changes, flushing cache
-----> Adding custom repositories
-----> Updating apt caches
Get:1 http://archive.ubuntu.com/ubuntu bionic InRelease [242 kB]
Get:2 http://apt.postgresql.org/pub/repos/apt bionic-pgdg InRelease [46.3 kB]
Get:3 http://archive.ubuntu.com/ubuntu bionic-security InRelease [88.7 kB]
Get:4 http://archive.ubuntu.com/ubuntu bionic-updates InRelease [88.7 kB]
Get:5 http://archive.ubuntu.com/ubuntu bionic/main amd64 Packages [1,344 kB]
Get:6 http://apt.postgresql.org/pub/repos/apt bionic-pgdg/main amd64 Packages [293 kB]
Compiling @angular/material/stepper : module as esm5
Compiling angular-animations : module as esm5
NOW IT STOPS. NOTHING.
52% building 354/357 modules 3 active ...timizer/webpack-loader.js??ref--8-0!/Users/philippmeissner/....
Compiling @Angular/core : module as esm5
Compiling @Angular/common : module as esm5
Compiling @Angular/platform-browser : module as esm5
Compiling @Angular/platform-browser-dynamic : module as esm5
Compiling @Angular/common/http : module as esm5
Compiling @Angular/forms : module as esm5
Compiling @Angular/cdk/keycodes : module as esm5
Compiling @Angular/cdk/platform : module as esm5
Compiling @Angular/cdk/observers : module as esm5
Compiling @Angular/cdk/a11y : module as esm5
import {HttpClientTestingModule, HttpTestingController} from '@angular/common/http/testing';
import {inject, TestBed} from '@angular/core/testing';
import {AviorBackendService} from './avior-backend.service';
describe('AviorBackendService', () => {
beforeEach(() => TestBed.configureTestingModule({
imports: [HttpClientTestingModule],
providers: [AviorBackendService],
}));