Skip to content

Instantly share code, notes, and snippets.

View msnazarow's full-sized avatar
🍏
Ios Developing

Михаил Назаров msnazarow

🍏
Ios Developing
  • Москва
View GitHub Profile
struct TopHalfCircle: Shape {
func path(in rect: CGRect) -> Path {
var path = Path()
path.addArc(
center: .zero,
radius: 1,
startAngle: .radians(.pi),
endAngle: .zero,
clockwise: false
@msnazarow
msnazarow / Image+Trim.swift
Last active December 7, 2023 05:18 — forked from chriszielinski/Image+Trim.swift
[Swift 5] NSImage/UIImage Crop/Trim Transparency
// Image+Trim.swift
//
// Copyright © 2020 Christopher Zielinski.
// https://gist.github.com/chriszielinski/aec9a2f2ba54745dc715dd55f5718177
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
#include <string.h>
#include <stdlib.h>
#include <ctype.h>
#include <stdio.h>
#include <stdbool.h>
typedef struct str_pos {
ssize_t letter_pos;
ssize_t word_pos;
} str_pos;
@msnazarow
msnazarow / main.c
Created November 18, 2021 17:40
BigInt
#include <iostream>
#include <vector>
#include <iomanip>
#define lenBigInt 9
#define divBigInt 1000000000
// Возвращет вектор в обратном порядке, 12 345 678 987 654 123 -> 987654123 12345678
std::vector<unsigned int> parseBigIntReverced(std::string str) {
int i = str.size();
#include <iostream>
#include <vector>
#include <iomanip>
#define lenBigInt 9
#define divBigInt 1000000000
// Возвращет вектор в обратном порядке, 12 345 678 987 654 123 -> 987654123 12345678
std::vector<unsigned int> parseBigIntReverced(std::string str) {
int i = str.size();