Skip to content

Instantly share code, notes, and snippets.

View ZAYEC77's full-sized avatar
:octocat:
piu-piu

Dmytro Karpovych ZAYEC77

:octocat:
piu-piu
View GitHub Profile
@ZAYEC77
ZAYEC77 / sand.py
Created September 5, 2023 23:30
sand.py
import ast
import os
import re
import traceback
import openai
openai.api_key = os.environ.get('OPENAI_API_KEY', '')
LOG_FILE = "log.txt"
@ZAYEC77
ZAYEC77 / tutorial.md
Last active August 11, 2023 08:20
Helm tutorial

Install helm

brew install helm
helm version

Configure autocomplete

source <(helm completion zsh)
@ZAYEC77
ZAYEC77 / mac_soft.md
Last active October 12, 2023 23:13
Mac minimal setup
const METHODS = {
TRACK: 'track',
IDENTIFY: 'identify',
};
class AnalyticsService {
providers = [];
idenitify(userId, userData) {
@ZAYEC77
ZAYEC77 / main.dart
Last active June 11, 2019 11:16
N mod D = 0 when N contains only 0 or 1
void main() {
print('D => N');
var length = 3000;
var map = primesMap().take(length).toList();
for (int d = 0; d < length; d++) {
var dd = map[d];
BigInt n = getN(BigInt.from(dd));
if (n == dd) {
print('prime here start ----');
@ZAYEC77
ZAYEC77 / Makefile
Last active April 18, 2019 12:07
Magento Makefile
db-name?=m2
db-host?=localhost
db-port?=3306
run:
php -S 127.0.0.1:80 -t ./pub/ ./phpserver/router.php
repl:
n98-magerun2.phar dev:console
homefy:
bin/magento config:set web/unsecure/base_url http://localhost/ && \
bin/magento config:set web/secure/base_url http://localhost/ && \
@ZAYEC77
ZAYEC77 / tolda.md
Last active April 3, 2019 09:10
Тольда Ноксель

Адам сидів у приймальній кімнаті та очікував своєї черги.

Він був останнім.

Крім нього у кімнаті було ще декілька людей:

Першою в черзі була жінка постбальзаківсього віку, після неї чоловік десь за тридцять.

Тут раптом до кімнати зайшла дівчина у супроводі двох молодиків, судячи з усього -- її охоронці.

var diff = -0.12;
async function changeRule(style) {
var result = {};
for (var i = 0; i < style.length; i++) {
try {
var property = style[i];
var value = style[property];
if (!value) {
continue;
@ZAYEC77
ZAYEC77 / etl.php
Last active January 24, 2019 15:28
<?php
function fixName($value) {
$value = mb_eregi_replace('й', 'й', $value);
$value = mb_eregi_replace('ё', 'ё', $value);
return $value;
}
function getDirs($path) {
return array_diff(scandir($path), array('..', '.'));
@ZAYEC77
ZAYEC77 / debian-server.sh
Last active August 16, 2018 23:23
debian-server
#!/bin/bash
# debian 9+
# Install common stuff
apt-get install bc apt-transport-https lsb-release ca-certificates console-cyrillic git-core rsync python-setuptools python-dev build-essential -y
# Check if the PHP version is valid and install it
installPhp() {