Skip to content

Instantly share code, notes, and snippets.

@vogdb
vogdb / migrate.md
Last active May 2, 2024 11:45
Directus. Migrate from Sqlite to MySQL.
  1. I use this docker-compose for MySQL
services:
 # Database
 db:
    image: mysql:8.0.35
    # volumes:
    #   - docker_mysql_data:/var/lib/mysql
    restart: always
    environment:
@vogdb
vogdb / nginx-tuning.md
Created December 19, 2023 11:31 — forked from denji/nginx-tuning.md
NGINX tuning for best performance

NGINX Tuning For Best Performance

For this configuration you can use web server you like, i decided, because i work mostly with it to use nginx.

Generally, properly configured nginx can handle up to 400K to 500K requests per second (clustered), most what i saw is 50K to 80K (non-clustered) requests per second and 30% CPU load, course, this was 2 x Intel Xeon with HyperThreading enabled, but it can work without problem on slower machines.

You must understand that this config is used in testing environment and not in production so you will need to find a way to implement most of those features best possible for your servers.

@vogdb
vogdb / .htaccess
Created April 12, 2023 06:25 — forked from abdelfattahradwan/.htaccess
.htaccess File for SvelteKit Single-Page-Applications
# Rewrite non /app/build/ requests to /app/build/
RewriteCond %{REQUEST_URI} !^/app/build/
RewriteRule ^(.*)$ /app/build/$1 [L]
# Rewrite requests to non-existing files/dirs to /app/build/index.html
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
@vogdb
vogdb / docker-compose.yml
Created February 3, 2023 05:43 — forked from fzliu/docker-compose.yml
Gitlab minimal memory installation via docker.
web:
image: 'gitlab/gitlab-ee:latest'
restart: always
hostname: 'gitlab.example.com'
environment:
GITLAB_OMNIBUS_CONFIG: |
external_url 'https://gitlab.example.com'
# Add any other gitlab.rb configuration here, each on its own line
puma['worker_processes'] = 0
sidekiq['max_concurrency'] = 10
@vogdb
vogdb / main.dart
Created November 5, 2022 11:29
Flutter Navigator 2 router and bloc
import 'package:bloc/bloc.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:meta/meta.dart';
void main() {
runApp(
BlocProvider(
create: (context) => MyBloc(),
child: MaterialApp(
@vogdb
vogdb / main.dart
Last active August 19, 2022 18:45
import 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
@vogdb
vogdb / 472363762biophys.hoc
Last active August 18, 2019 13:59
biophycs of Allen Institute DB model 472363762
// is the name L5PCbiophys fine?
// How should we reference the cell? $o1?
// Should we use $o1.distribute_channels?
begintemplate L5PCbiophys
public biophys
proc biophys() {
forsec $o1.all {
insert pas
#!/bin/sh
echo "IMPORTANT! INSTALL_DIR arg must be an absolute path!"
set -e
SRC_DIR=$1
INSTALL_DIR=$2
if [ ! -e ${INSTALL_DIR}/.install_finished ]
then
echo 'Neuron was not fully installed in previous build, installing ...'
@vogdb
vogdb / Android Privacy Policy Template
Last active March 12, 2019 13:48 — forked from alphamu/Android Privacy Policy Template
A template for creating your own privacy policy for Android apps. Look for "[" and "<!--" to see where you need to edit this app in order to create your own privacy olicy.
<html>
<body>
<h2>Privacy Policy</h2>
<p>Aleksei Sanin built the NGS Run Calculator (com.asanin.ngs.run.calculator) app as a free app. This SERVICE is provided by Aleksei Sanin at no cost and is intended
for use as is.</p>
<p>This page is used to inform website visitors regarding my policies with the collection, use, and
disclosure of Personal Information if anyone decided to use my Service.</p>
<p>If you choose to use my Service, then you agree to the collection and use of information in
relation with this policy. The Personal Information that I collect are used for providing and
improving the Service. I will not use or share your information with anyone except as described
@vogdb
vogdb / object_copy.js
Created February 3, 2019 15:52
Задача по копированию объектов в js
// пример глубокого копирования в Javascript. Берет на вход объект obj и возвращает его глубокую копию.
function deepCopy(obj) {
return JSON.parse(JSON.stringify(obj));
}
// Каковы значения `o_direct`, `o_shallow`, `o_deep` в каждом нижеприведенном блоке кода?
// Каждый блок кода отделен друг от друга длинным комментарием `/////////////////`.
// Считается, что каждый блок исполняется независимо друг от друга.
function a_b_numbers() {