Skip to content

Instantly share code, notes, and snippets.

View fnnzzz's full-sized avatar

Vlad Feninets fnnzzz

View GitHub Profile
@fnnzzz
fnnzzz / sentry.js
Last active January 28, 2022 13:11
sentry owners
// 1 - create file `sentry.js` in root and copy&paste code
// 2 - run `node sentry.js`
// 3 - paste result here https://sentry.io/settings/rabotaua-eb/projects/alliance-desktop/ownership/
const fs = require('fs')
const path = require('path')
const codeowners = fs.readFileSync(path.join(__dirname, '.github/CODEOWNERS'), 'utf-8')
@fnnzzz
fnnzzz / pipe.ts
Created December 30, 2021 11:19
refactoring pipes via ts-morph
import { Project, SyntaxKind } from 'ts-morph'
import { join } from 'path'
const sharedPipes = new Project({})
sharedPipes.addSourceFilesAtPaths(join(__dirname, '../../libs/shared/pipes/**/(*.pipe.ts)'))
/* делаем словарик интересующих нас пайпов, на выходе будет массив вроде такого
* {
importPath: '@alliance/shared/pipes/time-period',
pipeName: 'timePeriod',
var markup = document.querySelector('#app-desktop-state').textContent
function unescapeHtml(text) {
const unescapedText = {
'&a;': '&',
'&q;': '"',
'&s;': '\'',
'&l;': '<',
'&g;': '>',
};
import * as Types from '../../types-generated';
import { gql } from 'apollo-angular';
import { Injectable } from '@angular/core';
import * as Apollo from 'apollo-angular';
export type BranchDictionaryItemFragment = (
{ readonly __typename?: 'Branch' }
& Pick<Types.Branch, 'id' | 'name'>
);
document.addEventListener('copy', async function(e) {
try {
const clipboardItems = await navigator.clipboard.read();
for (const clipboardItem of clipboardItems) {
for (const type of clipboardItem.types) {
const blob = await clipboardItem.getType(type);
console.log(await blob.text())
}
}
@fnnzzz
fnnzzz / form.ts
Created May 23, 2019 15:38
angular form
public acmeControl = new FormControl('', [Validators.required, Validators.pattern(constants.EMAIL_PATTERN)])
this.fb.group({
acme: this.acmeControl,
})
///////////////
@fnnzzz
fnnzzz / sentry.js
Created September 12, 2018 11:49
sentry error structure
{
"project": "1246932",
"logger": "javascript",
"platform": "javascript",
"request": {
"headers": {
"User-Agent": "Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.106 Safari/537.36"
},
"url": "https://admin8.rua5069.rabota.ua/pages/action/list.aspx"
},
+380444449933
+38 0444449933
+38 044 4449933
+38044 4449933
(+380)984445544
+380 973334433
+38(098) 3343344
+38(098)3343344
+380 (98)3334455
+380 (98) 3334455
@fnnzzz
fnnzzz / push.js
Created June 26, 2018 12:00
aleksandro data layer
dataLayer.push({
'eventCategory': 'cvBilderMobileBE',
'eventAction': 'next step',
'eventLabel': 'step1 to step2',
'event': 'autoEvent'
});
@fnnzzz
fnnzzz / sert.bat
Last active February 21, 2019 13:03
rua cert
CREATE NEW:
New-SelfSignedCertificate -NotAfter (Get-Date).AddYears(10) -DnsName '*.mac.rabota.ua', 'mac.rabota.ua' -CertStoreLocation Cert:\LocalMachine\My
ADD TO TRUST:
$req = [Net.WebRequest]::Create('https://dev.rabota.ua/')
try { $req.GetResponse() } catch {}
$cert = $req.ServicePoint.Certificate
$bytes = $cert.Export([Security.Cryptography.X509Certificates.X509ContentType]::Cert)
$target = "$([Environment]::GetFolderPath('Desktop'))\cert.cer"
Set-Content -Value $bytes -Encoding Byte -Path $target