Skip to content

Instantly share code, notes, and snippets.

View a-x-'s full-sized avatar
🛩️

Alexander a-x-

🛩️
View GitHub Profile
You are ChatGPT, a large language model trained by OpenAI.
You are chatting with the user via the ChatGPT iOS app. This means most of the time your lines should be a sentence or two, unless the user’s request requires reasoning or long-form outputs. Never use emojis, unless explicitly asked to.
Knowledge cutoff: 2024-06
Current date: 2025-04-27
Image input capabilities: Enabled
Personality: v2
Over the course of the conversation, you adapt to the user’s tone and preference. Try to match the user’s vibe, tone, and generally how they are speaking. You want the conversation to feel natural. You engage in authentic conversation by responding to the information provided and showing genuine curiosity. Ask a very simple, single-sentence follow-up question when natural. Do not ask more than one follow-up question unless the user specifically asks. If you offer to provide a diagram, photo, or other visual aid to the user, and they accept, use the search tool, not the image_gen tool (unless they ask for something ar
@a-x-
a-x- / calc-optimal-iPhone-owning.py
Created November 24, 2024 07:53
Оптимальная стратегия минимизации расходов на iPhone
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
# Исходные данные: модели iPhone, их стартовые цены и год выпуска
iphone_data = {
'model': ['iPhone 15', 'iPhone 14', 'iPhone 13', 'iPhone 12', 'iPhone 11'],
'release_year': [2023, 2022, 2021, 2020, 2019],
'initial_price': [1000, 900, 800, 700, 600] # Предполагаемые цены в $
}
// Купи батон хлеба, если будут яйца - возьми десяток.
if (eggs) {
buyEggs();
}
if (bread) {
buyBread();
}
/*
@a-x-
a-x- / ir_led.esphome.yaml
Last active April 5, 2021 15:40
ir transmitter for samsung tv q9 and sven 5.1 audio; led highlight under couch
esphome:
name: esp_living_couch1
platform: ESP8266
board: d1_mini
wifi:
ssid: "grove"
password: "0My%Secur"
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
@a-x-
a-x- / esphome-mh-z19b.yaml
Last active April 1, 2021 17:03
ESPHome CO₂ Sensor (MH-Z19B) Part of Config
#
# CO2 Sensor
# После прошивки надо выставить в открытое окно и выполнить эту команду ручного сброса нуля, которое запомнится в датчике
# HA > Developer tools > Call Service > Name: service.<ESP_NAME>_mhz19_calibrate_zero
api:
services:
- service: mhz19_calibrate_zero
then:
- mhz19.calibrate_zero: sensor_mhz19
title: Home
views:
- title: Домофон
path: ''
icon: 'hass:phone'
badges: []
cards:
- type: entities
entities:
- entity: binary_sensor.domofon_incoming_call
@a-x-
a-x- / Flow.tsx
Created September 10, 2020 23:32
Поток вёрстки — React обёртка над flexbox. <Flow row size="1rem"><Button/><Button/></Flow>
import React, { ReactNode } from 'react'
import styled from 'styled-components'
/** Nice flexbox wrapper */
type CrossAlign = 'start' | 'end' | 'center' | 'stretch' | 'baseline'
export interface FlowProps {
children: ReactNode
// direction shortcut
row?: boolean
type BankCode =
| 'Alfa'
| 'Baltiyskiy'
| 'Binbank'
| 'Europe'
| 'Gazprombank'
| 'HomeCredit'
| 'Mdm'
| 'Mkb'
| 'Moscow'
@a-x-
a-x- / Flow.tsx
Last active July 21, 2020 14:26
Flexbox wrappper for React
import React, { ReactNode } from 'react';
import styled from 'styled-components';
/**
* Nice flexbox wrapper
* @example <Flow col size="1rem">...</Flow> // 1rem = 1unit = 8px
*/
interface Props {
children: ReactNode,
#
# RubyReactAdmin. ActiveAdmin like controller API, возвращающее TR-D json
# для отображения React-интерфейсе без js-кода для дефолтных сценариев
# с несложными кастомизациями фронта по необходимости лучшими фронтовыми технологиями
#
# todo: render_json, render_json_error, render_json_exception
# todo:
module Admin