Skip to content

Instantly share code, notes, and snippets.

View Pash237's full-sized avatar

Pavel Alexeev Pash237

View GitHub Profile
@Pash237
Pash237 / remove_google_photos.js
Last active June 27, 2020 13:58
Script to remove Nikon SnapBridge images from Google Photos
#!/usr/bin/env node
var fs = require("fs");
var argv = process.argv.slice(2);
var exec = require('await-exec');
class Photo {
constructor(id) {
this.id = id;
this.filename = null;
@pteasima
pteasima / OnScroll.swift
Last active December 16, 2020 17:35
SwiftUI onScroll
import SwiftUI
import Combine
struct OnScroll: ViewModifier {
@Binding var offset: CGFloat
//we can have a version with a closure instead of the binding, but that triggers an infinite loop if content depends on the same Store
// var onOffset: (CGFloat) -> ()
func body(content: Content) -> some View {
return VStack {

Упал с высоты в Турции 24 сентября 2019, был вывих и перелом большеберцовой кости в голеностопе со смещением. В больнице турки сделали операцию, зафиксировали отломок биодеградируемыми винтами, голеностоп зафиксировали аппаратом внешней фиксации вместо гипса. Но в результате отколок сместился и срастается в смещённом положении.

В РНИИТО им. Р.Р. Вредена сказали, что повторную операцию делать уже поздно. Суставная поверхность сильно повреждена, так что скорее всего сустав долго не протянет и нужно морально готовится к артродезу. Про эндопротезы для голеностопа сказали, что они очень недолговечные и нет смысла мне, молодому, такой ставить. Заключение из Вредена.

На данный момент аппарат внешней фиксации демонтирован, ногу разрабатываю.


Обследования:

МРТ (19 ноября 2020):

//
// FreeDrawingImageView.swift
//
// Created by Besher on 2018-12-30.
// Copyright © 2018 Besher Al Maleh. All rights reserved.
//
import UIKit
class FreeDrawingImageViewDrawLayer: UIView {
@himanshujexzeo
himanshujexzeo / Default UIContentSizeCategory
Created October 4, 2016 06:49
Default UIContentSizeCategory For Supporting Dynamic Type in iOS
let defaultFontSizeTable = [
UIFontTextStyleHeadline: [
UIContentSizeCategoryAccessibilityExtraExtraExtraLarge: 26,
UIContentSizeCategoryAccessibilityExtraExtraLarge: 25,
UIContentSizeCategoryAccessibilityExtraLarge: 24,
UIContentSizeCategoryAccessibilityLarge: 24,
UIContentSizeCategoryAccessibilityMedium: 23,
UIContentSizeCategoryExtraExtraExtraLarge: 23,
UIContentSizeCategoryExtraExtraLarge: 22,
UIContentSizeCategoryExtraLarge: 21,
@pthrasher
pthrasher / README.md
Created February 16, 2016 20:22 — forked from 0x3333/README.md
Mac OS X - Wallpaper Changer - Swift

Mac OS X - Wallpaper Changer

Swift code to change the Wallpaper for all screens. Currently, it changes only the current spaces' wallpaper. I'm working on a version to change in all spaces.

Usage: WallpaperChanger "/Users/username/SomeFolder/SomePicture.jpg"

@TimOliver
TimOliver / UIScrollView+ZoomToPoint.m
Last active November 23, 2022 09:14
Zooming to a specific CGPoint inside a UIScrollView (2015 Edition)
@implementation UIScrollView (ZoomToPoint)
/**
Zooms into the specified point of the scroll view's zoomable content view at the supplied scaled.
(The zoomable content view is the view that is returned in `viewForZoomingInScrollView:`
@param zoomPoint - In terms of the scroll view's co-ordinate space, the point to zoom to
@param scale - A value between minimumZoomScale and maximumZoomScale in which to zoom to.
@param animated - Whether the transition is animated, or instant
@joshdholtz
joshdholtz / SomeFragment.java
Last active December 22, 2022 09:41
Android Google Maps V2 - MapView in XML
public class SomeFragment extends Fragment {
MapView mapView;
GoogleMap map;
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View v = inflater.inflate(R.layout.some_layout, container, false);
@zachwaugh
zachwaugh / switch-shortcut.swift
Last active February 6, 2023 16:15
Swift shortcut for returning and/or assigning the result of switch statement?
// Can currently do this
func titleForSection1(section: Int) -> String? {
switch section {
case 0: return "Foo"
case 1: return "Bar"
default: return nil
}
}
// But I want to do this to remove the redundant returns
@janselv
janselv / UIBezierPathLength.swift
Last active March 8, 2023 08:20
Get total iOS CGPath length as an extension of UIBezierPath written in swift
// The MIT License (MIT)
//
// Copyright (c) 2016 Jansel Valentin
//
// 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
// furnished to do so, subject to the following conditions: