Skip to content

Instantly share code, notes, and snippets.

View alimovlex's full-sized avatar
⚔️
𝔇𝔦𝔢 𝔇𝔦𝔰𝔷𝔦𝔭𝔩𝔦𝔫 𝔦𝔰𝔱 𝔡𝔢𝔯 𝔖𝔠𝔥𝔩𝔲̈𝔰𝔰𝔢𝔩 𝔷𝔲𝔪 𝔈𝔯𝔣𝔬𝔩𝔤.

Аλέξιος alimovlex

⚔️
𝔇𝔦𝔢 𝔇𝔦𝔰𝔷𝔦𝔭𝔩𝔦𝔫 𝔦𝔰𝔱 𝔡𝔢𝔯 𝔖𝔠𝔥𝔩𝔲̈𝔰𝔰𝔢𝔩 𝔷𝔲𝔪 𝔈𝔯𝔣𝔬𝔩𝔤.
  • RecompileMe
  • Metaverse
View GitHub Profile
@alimovlex
alimovlex / protobufTcpServer.cpp
Created August 12, 2024 15:58
A simple TCP C++ server that deserializes protobuf message and prints it out to the console.
/*
* Copyright (C) 2024 Recompile.me.
* All rights reserved.
*/
#include <iostream>
#include <string>
#include <stdio.h>
#include <sys/types.h>
#include <sys/socket.h>
@alimovlex
alimovlex / protobufTcpClient.cpp
Last active August 12, 2024 15:58
A simple TCP C++ client that sends a serialized message to the server on Enter pressed.
/*
* Copyright (C) 2024 Recompile.me.
* All rights reserved.
*/
#include <iostream>
#include <string>
#include <stdio.h>
#include <sys/types.h>
#include <sys/socket.h>
@alimovlex
alimovlex / REST_Communicator.swift
Last active February 15, 2023 17:53
The RESTful api demo class for iOS
/*
* Copyright (C) 2023 Recompile.me.
* All rights reserved.
*/
import Alamofire
import Foundation
import SwiftyJSON
typealias DownloadComplete = () -> ();
@alimovlex
alimovlex / BLE_Communicator_Transceiver.swift
Last active February 15, 2023 16:40
The BLE demo code for the data transmission.
/*
* Copyright (C) 2023 Recompile.me.
* All rights reserved.
*/
import CoreBluetooth
class BLE_Communicator: CBCentralManagerDelegate, CBPeripheralDelegate {
//The UUID of your BLE device.
@alimovlex
alimovlex / TCP_Communicator.swift
Last active June 9, 2023 21:50
The TCP connection demo for iOS
/*
* Copyright (C) 2023 Recompile.me.
* All rights reserved.
*/
class TCP_Communicator: NSObject, StreamDelegate {
var readStream: Unmanaged<CFReadStream>?
var writeStream: Unmanaged<CFWriteStream>?
var inputStream: InputStream?
@alimovlex
alimovlex / CoreLocation.swift
Last active February 15, 2023 16:41
The location service class for iOS devices written in Swift.
/*
* Copyright (C) 2023 Recompile.me.
* All rights reserved.
*/
import CoreLocation
class Navigator: NSObject, CLLocationManagerDelegate {
let locationManager = CLLocationManager();
@alimovlex
alimovlex / BLE_Communicator.swift
Last active February 15, 2023 16:45
The BLE connection implementation for iOS in Swift.
/*
* Copyright (C) 2023 Recompile.me.
* All rights reserved.
*/
import CoreBluetooth
class BLE_Communicator: CBCentralManagerDelegate, CBPeripheralDelegate {
let DEVICE_SERVICE_UUID = CBUUID.init(string: "b4250400-fb4b-4746-b2b0-93f0e61122c6");
@alimovlex
alimovlex / Package.swift
Last active February 15, 2023 16:42
The Swift's package linker with C/C++ library
// swift-tools-version:4.0
/*
* Copyright (C) 2023 Recompile.me.
* All rights reserved.
*/
import PackageDescription
let package = Package(
name: "SwiftCPP", //your project's name where the main.swift is stored. It is similar to the folder's name.
@alimovlex
alimovlex / storage.swift
Last active February 15, 2023 16:43
The coreData stack for iOS 9 and iOS 10
/*
* Copyright (C) 2023 Recompile.me.
* All rights reserved.
*/
// MARK: - Core Data stack
@available(iOS 10.0, *)
lazy var persistentContainer: NSPersistentContainer = {
//goalpost.xcdatamodeld The name of the CoreData model
let container = NSPersistentContainer(name: "goalpost")