Skip to content

Instantly share code, notes, and snippets.

View doomkit's full-sized avatar
:shipit:
Focusing

Nikita Shkarupa doomkit

:shipit:
Focusing
View GitHub Profile
@doomkit
doomkit / .html
Last active December 24, 2020 14:28
Random
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Document</title>
</head>
<body>
<header>
<h1>My HTML Input</h1>
@doomkit
doomkit / .env.pgweb
Created October 30, 2020 23:49
Docker compose: Postgres + PGWeb
DATABASE_URL=postgres://postgres:postgres@postgres:5432/postgres?sslmode=disable
@doomkit
doomkit / click-outside.js
Created October 22, 2020 10:09
Vue 3 ClickOutside directive
export const ClickOutsideDirective = {
beforeMount(el, binding) {
el.clickOutsideEvent = function(event) {
if (!(el == event.target || el.contains(event.target))) binding.value();
};
document.body.addEventListener('click', el.clickOutsideEvent);
},
unmounted(el) {
document.body.removeEventListener('click', el.clickOutsideEvent);
},
@doomkit
doomkit / ipv4-validator.spec.ts
Created October 21, 2020 23:44
Angular IPv4 address FormControl Validator
import { Component } from '@angular/core';
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { ReactiveFormsModule, FormGroup, FormControl } from '@angular/forms';
import { IPv4Validator } from './ipv4-validator';
describe('IPv4Validator', () => {
let component: TestComponent;
let fixture: ComponentFixture<TestComponent>;
beforeEach(async(() => {
@doomkit
doomkit / print.css
Created May 18, 2020 19:02
Print to pdf issue
.thing {
-webkit-print-color-adjust:exact;
-webkit-filter:opacity(1);
}
@doomkit
doomkit / gitconf.md
Created September 11, 2019 10:34
[git] Filename too long (Windows)

Git has a limit of 4096 characters for a filename, except on Windows when Git is compiled with msys.
It uses an older version of the Windows API and there's a limit of 260 characters for a filename.

git config --system core.longpaths true

Read more.

@doomkit
doomkit / browserconfig.xml
Created September 8, 2019 19:39
Favicons 2019
<?xml version="1.0" encoding="utf-8"?>
<browserconfig>
<msapplication>
<tile>
<square70x70logo src=“favicon-76.png”/>
<square150x150logo src="favicon-228.png"/>
<TileColor>#2b5797</TileColor>
</tile>
</msapplication>
</browserconfig>
@doomkit
doomkit / tsconfig.json
Created August 23, 2019 08:12
TypeScript import paths
{
"compilerOptions": {
"paths": {
"@app/*": ["src/app/*"],
"@env/*": ["src/environments/*"],
"@shared/*": ["src/app/shared/*"],
"@core/*": ["src/app/core/*"]
}
}
}
$ git remote rm origin
$ git remote add origin [email protected]:aplikacjainfo/proj1.git
$ git config master.remote origin
$ git config master.merge refs/heads/master
@doomkit
doomkit / .scss
Created August 11, 2018 20:21
Overlay play/pause buttons
.button {
position: absolute;
top: calc(50% - 50px);
left: calc(50% - 50px);
width: 100px;
height: 100px;
background-color: #27d6e6;
border-radius: 50%;
cursor: pointer;