Skip to content

Instantly share code, notes, and snippets.

.onReceive(timer) { (_) in
if !self.gameOver {
self.changeDirection()
if self.posArray[0] == self.foodPos {
self.posArray.append(self.posArray[0])
self.foodPos = self.changeRectPos()
}
}
}
.edgesIgnoringSafeArea(.all)
import PlaygroundSupport
import Foundation
import Combine
// MARK: - Network Controller
protocol NetworkControllerProtocol: class {
typealias Headers = [String: Any]
func get<T>(type: T.Type,
url: URL,
//
// ContentView.swift
// Shared
//
// Created by Mohammad Azam on 7/29/20.
//
import SwiftUI
// Original article here: https://www.fivestars.blog/code/swiftui-hierarchy-list.html
import SwiftUI
struct FileItem: Identifiable {
let name: String
var children: [FileItem]?
var id: String { name }
@jterral
jterral / azure-pipelines__ios__.yaml
Last active July 19, 2024 03:30
Azure Pipelines to build and deploy iOS appplication with AppCenter
#
# Azure Pipelines
trigger:
batch: true
name: $(Build.BuildId)_$(SourceBranchName)_$(Date:yyyyMMdd)$(Rev:.r)
variables:
- group: my-group-var
//
// FetchView.swift
//
// Created by Roberto Breve on 4.10.2019.
// Copyright © 2019 Roberto Breve . All rights reserved.
//
import Foundation
import SwiftUI
import Combine
@deepakraj27
deepakraj27 / AttachmentHandler.swift
Last active November 1, 2023 08:40
Access Camera, Photo Library, Video and File from User device using Swift 4
//
// AttachmentHandler.swift
// AttachmentHandler
//
// Created by Deepak on 25/01/18.
// Copyright © 2018 Deepak. All rights reserved.
//
import Foundation
import UIKit
@TheWaWaR
TheWaWaR / flask_dump_request_response.py
Last active March 10, 2024 14:38
Flask dump request and response example
#!/usr/bin/env python
# coding: utf-8
import os
import sys
import json
import uuid
import tempfile
from flask import Flask, request, Response, g