Skip to content

Instantly share code, notes, and snippets.

View voznik's full-sized avatar
🤔
Open for opportunities

Vadym Parakonnyi voznik

🤔
Open for opportunities
View GitHub Profile
@voznik
voznik / config.fish
Created June 23, 2020 08:22 — forked from dmccombs/config.fish
A simple way to use the GNOME keyring for SSH key managment in fish shell
# Add this to the bottom of your config.fish file
# Set SSH to use Gnome keyring
set -gx SSH_AUTH_SOCK (gnome-keyring-daemon --start | grep "^SSH_AUTH_SOCK" | awk -F "=" '{print $2}')
@voznik
voznik / drawing-board.component.ts
Created June 15, 2020 14:43 — forked from anupkrbid/drawing-board.component.ts
A example canvas component for drawing in an angular 6 app using rxjs 6.
import {
AfterViewInit,
Component,
ElementRef,
Input,
OnDestroy,
ViewChild
} from '@angular/core';
import { fromEvent } from 'rxjs';
import { pairwise, switchMap, takeUntil } from 'rxjs/operators';
(function (context, trackingId, options) {
const history = context.history;
const doc = document;
const nav = navigator || {};
const storage = localStorage;
const encode = encodeURIComponent;
const pushState = history.pushState;
const typeException = 'exception';
const generateId = () => Math.random().toString(36);
const getId = () => {
@voznik
voznik / beforeOnDestroy.ts
Created September 16, 2019 14:52
Angular Component "before destroy"
import { Component, Input, OnDestroy } from '@angular/core';
import { timer } from 'rxjs';
import { timeInterval, pluck, take} from 'rxjs/operators';
interface BeforeOnDestroy {
ngxBeforeOnDestroy();
}
type NgxInstance = BeforeOnDestroy & Object;
type Descriptor = TypedPropertyDescriptor<Function>;
@voznik
voznik / app.py
Created July 25, 2019 09:25 — forked from egealpay/app.py
from flask import Flask, jsonify
from flask_restful import Api
from flask_jwt_extended import JWTManager
from resources.user import User, UserRegister, UserLogin
import os
app = Flask(__name__)
app.config["SQLALCHEMY_DATABASE_URI"] = os.environ.get("DATABASE_URL", "sqlite:///data.db")
@voznik
voznik / app.py
Created June 24, 2019 07:52 — forked from calderonroberto/app.py
Flask Redis Example
#!/bin/python
# Dependencies:
# pip install flask
# pip install redis
from flask import Flask
from flask import request
import flask
import redis
@voznik
voznik / update-cordova-version.js
Created June 14, 2019 09:48
Updates cordova `config.xml` version from npm version. Also creates or updates `$VERSION` environment variable in .env file. (Bash vs Node)
/**
* Creates or updates `version.json` file with git version info
* Updates cordova `config.xml` version from npm version.
*/
const { gitDescribeSync } = require('git-describe');
const { resolve, relative } = require('path');
const { writeFileSync } = require('fs');
const cordovaSetVersion = require('cordova-set-version');
const version = process.env.npm_package_version;
@voznik
voznik / doublecmd.xml
Created April 10, 2019 12:20
doublecmd solarized color theme
<Colors>
<FileFilters>
<Filter>
<Name>Pascal sources</Name>
<FileMasks>*.html;*.twig;*.md</FileMasks>
<Color>13842050</Color>
<Attributes/>
</Filter>
<Filter>
<Name>Pascal binaries</Name>
@voznik
voznik / clean-old-snaps.sh
Created April 10, 2019 07:04 — forked from jdatti/ubuntu18-clean-old-snaps.sh
Ubuntu clean old snaps
#!/bin/bash
# Removes old revisions of snaps
# CLOSE ALL SNAPS BEFORE RUNNING THIS
set -eu
snap list --all | awk '/disabled/{print $1, $3}' |
while read snapname revision; do
snap remove "$snapname" --revision="$revision"
done
@voznik
voznik / angular_code_review_checklist.md
Last active August 4, 2022 19:23 — forked from mrmeku/CODING_GUIDELINES.md
angular_code_review_checklist

Coding guidelines

This document is split into three sections

  1. On General Code Health. This section contains guidelines intended encourage patterns which produce more maintainable, less bug prone, code.
  2. On Angular Best Practices. This section outlines the practices related to Angular, Typescript, RxJs and @ngrx/store. Following these general coding guidelines will help make the application cleaner.
  3. On Angular Performance. This section contains guidelines intended to make an Angular app trigger change detection less often and on less entities.