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 / init.coffee
Last active April 25, 2018 09:15
voznik's atom settings
# Made with ♥ for a healthy Atom.
# Avoid copy empty lines.
# https://discuss.atom.io/t/resolved-avoid-copying-when-selection-is-empty/
atom.commands.add 'atom-text-editor', 'core:copy', (e) ->
editor = e.currentTarget.getModel()
return if editor.getSelectedBufferRanges().length > 1
{start, end} = editor.getSelectedBufferRange()
if start.column is end.column and start.row is end.row
e.stopImmediatePropagation()

Multi-site setup (false)

"Or why have 30 admin panels when one would probably suffice," for people with way too many sites.

The base idea is to achieve a multi-site setup that is both more flexible and simpler than native Grav multi-site handling. One major advantage of such a setup is it makes it feasible to have completely different URLs for the different sites.

The strategy used to achieve this uses a combination of (hard) symbolic links, theme-layer taxonomy filtering and homepage configuration for each site.

Folder structure

  • public_html - Web folder on your server.
    • pages symlinked - Present outside of the Grav installations for convenient access without having to rely on admin interface.
{
"autocomplete": true,
"autoimport": true,
"enable_auto_align": false,
"format_on_save": true,
"ignore": "Parent",
"indent_with_space": 4,
"passes":
[
"ReindentSwitchBlocks",
@voznik
voznik / cloudSettings
Last active September 17, 2023 12:26
Visual Studio Code Settings Sync Gist
{"lastUpload":"2021-08-11T06:32:52.371Z","extensionVersion":"v3.4.3"}
@voznik
voznik / runserver.py
Last active June 30, 2018 15:47 — forked from mozz100/runserver.py
Change default port for django runserver
# Put this at <yourapp>/management/commands/runserver.py.
# Override the value of the constant coded into django...
import django.core.management.commands.runserver as runserver
runserver.DEFAULT_ADDR="0.0.0.0"
runserver.DEFAULT_PORT="8080"
# ...and then just import its standard Command class.
# Then manage.py runserver behaves normally in all other regards.
from django.core.management.commands.runserver import Command
@voznik
voznik / MultiTenantFlask.py
Created July 3, 2018 23:36 — forked from TonyFrancis/MultiTenantFlask.py
Creating multi Tenant system with multiple Database. Switching between databases based on subdomain related to tenant
from functools import wraps
from flask import Flask, g, session, request, abort, jsonify
from flask_migrate import MigrateCommand, Migrate
from flask_script import Manager
from flask_sqlalchemy import SQLAlchemy
flask_app = Flask(__name__, static_folder='./static')
db = SQLAlchemy()
migrate = Migrate()
@voznik
voznik / lazylibs.service.ts
Created November 6, 2018 11:40 — forked from JohannesRudolph/lazylibs.service.ts
Angular lazy library loader
import { Injectable, Inject } from '@angular/core';
import { Observable } from 'rxjs/Observable';
import { ReplaySubject } from 'rxjs/ReplaySubject';
import { DOCUMENT } from '@angular/platform-browser';
@Injectable()
export class LazylibsService {
private chartJs?: ReplaySubject<any>;
@voznik
voznik / keybase.md
Last active January 23, 2019 21:03

Keybase proof

I hereby claim:

  • I am voznik on github.
  • I am voznik (https://keybase.io/voznik) on keybase.
  • I have a public key ASCoCZHzSWPjr0catsgfrpDtcKKX6CS51vbQNr4nPjJfoQo

To claim this, I am signing this object:

@voznik
voznik / iframeResizer.directive.ts
Created December 17, 2018 10:55 — forked from drakkein/iframeResizer.directive.ts
iframe resizer directive for Angular 4 (No CORS)
import { Directive, ElementRef, OnDestroy, OnInit, Renderer2 } from '@angular/core';
@Directive({
selector: '[iframeResize]',
})
export class IframeResizeDirective implements OnInit, OnDestroy {
private listener: () => void;
private observer: MutationObserver;
get element() {
@voznik
voznik / index.html
Last active December 18, 2018 22:05
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>The HTML5 StarWars</title>
<meta name="description" content="The HTML5 StarWars">
<meta name="author" content="voznik">