Skip to content

Instantly share code, notes, and snippets.

View sunmeat's full-sized avatar
🐈
MEOW

Oleksandr Zahoruiko sunmeat

🐈
MEOW
View GitHub Profile
@sunmeat
sunmeat / task.md
Last active April 10, 2026 08:44
ДЗ гороскоп

🌟 Програма «Гороскоп на сьогодні та завтра»

Мова програмування: C++
Тип програми: Консольна

Опис завдання

Написати консольну програму, яка дозволяє користувачеві обрати знак зодіаку та отримати гороскоп на сьогодні та на завтра.

Основна функціональність

@sunmeat
sunmeat / main.cpp
Created April 10, 2026 05:24
cpp console app and php integration (http example) mac os version
# треба встановити curl (якщо ще немає)
brew install curl
# якщо немає Homebrew - спочатку треба встановити його:
# /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
======================================================================================================================
#include <iostream>
#include <string>
@sunmeat
sunmeat / client.cpp
Created April 7, 2026 15:57
приклад на парі 07.04.2026
#define WIN32_LEAN_AND_MEAN
#include <iostream>
#include <ws2tcpip.h>
using namespace std;
#pragma comment (lib, "Ws2_32.lib")
#pragma comment (lib, "Mswsock.lib") // AcceptEx(), ConnectEx(), WSASendMsg() тощо
#pragma comment (lib, "AdvApi32.lib") // Security API, Registry API, Service Control Manager тощо
@sunmeat
sunmeat / main.cpp
Created April 3, 2026 05:30
get file from hosting mac os version
#include <iostream>
#include <string>
#include <curl/curl.h>
using namespace std;
size_t write_data(void* ptr, size_t size, size_t nmemb, FILE* stream) {
return fwrite(ptr, size, nmemb, stream);
}
@sunmeat
sunmeat / main.cpp
Created April 3, 2026 05:27
get html page text C++ example HTTP GET mac os version
#include <iostream>
#include <string>
#include <cstring>
#include <sys/socket.h>
#include <netdb.h>
#include <unistd.h>
using namespace std;
int main() {
string url = "google.com";
@sunmeat
sunmeat / different files.kt
Created March 29, 2026 11:33
jetpack compose example
build.gradle.kts (Project):
plugins {
alias(libs.plugins.android.application) apply false
kotlin("plugin.compose") version "2.0.21" apply false // !!!
}
==================================================================================================================
build.gradle.kts (Module:app):
<?xml version="1.0" encoding="utf-8"?>
<androidx.coordinatorlayout.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#0A0A0F">
<!-- Декоративне коло вгорі -->
<View
@sunmeat
sunmeat / different files.cpp
Created March 27, 2026 09:04
one server multiple clients C++ example (UDP) mac os version
SERVER SIDE:
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <unistd.h>
#include <iostream>
#include <vector>
#include <string>
#include <cstring>
@sunmeat
sunmeat / different files.cpp
Created March 27, 2026 06:49
client server UDP C++ example mac os version
CLIENT SIDE:
#include <iostream>
#include <cstring>
#include <cstdlib>
#include <unistd.h>
#include <arpa/inet.h>
#include <sys/socket.h>
using namespace std;
@sunmeat
sunmeat / views.py
Created March 25, 2026 14:09
запити1-М та агрегування + raw queries
from datetime import datetime
from django.shortcuts import render
from django.http import HttpRequest
from django.db.models import Avg, Count, Sum, Max, Min, F, Q
from app.models import Author, Book
# =============================================================================
# CRUD ДЛЯ AUTHOR (це було вже :)
# =============================================================================