Skip to content

Instantly share code, notes, and snippets.

View MicrexIT's full-sized avatar

Michele Rexha MicrexIT

View GitHub Profile
@MicrexIT
MicrexIT / COVID-19-xray-DL.ipynb
Last active March 25, 2020 11:10
Deep Learning approach to COVID-19 detection using x-ray chest scans
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@MicrexIT
MicrexIT / run.sh
Created April 21, 2020 13:08
Run Vapor Docker Image
docker build -t vapor-image .
docker run --name vapor-server -p 8080:8080 vapor-image
@MicrexIT
MicrexIT / install.sh
Created April 21, 2020 13:09
Install vapor toolbox
git clone https://github.com/vapor/toolbox.git
cd toolbox
# git checkout <desired version>
swift build -c release --disable-sandbox
mv .build/release/vapor /usr/local/bin
@MicrexIT
MicrexIT / create-vapor-hello-world.sh
Created April 21, 2020 13:51
Create Vapor framework Hello World app
# cd ..
vapor new helloWorld
app.get("hello") { req -> String in
// return "Hello, World!"
return "Hello, 🌍!"
}
@MicrexIT
MicrexIT / vapor-help
Created April 21, 2020 17:11
Vapor Help
vapor --help
@MicrexIT
MicrexIT / Dockerfile
Last active April 22, 2020 13:13
Vapor Dockerfile Multistage build and run
# ================================
# Build image
# ================================
FROM vapor/swift:latest as build
WORKDIR /build
# First just resolve dependencies. This creates a cached layer that can be reused
# as long as your Package.swift/Package.resolved files do not change.
COPY ./Package.* ./
RUN swift package resolve
var numbersArry = [1, 2] // array of Int
var numbersDict = ["one":1, "two":2] // dictionary mapping String to Int
var favoriteGenres: Set<String> = ["Rock", "Classical", "Hip hop"] // set of Strings
@MicrexIT
MicrexIT / SwiftBasicsArrDicSetExample.swift
Created May 1, 2020 08:04
Swift basics arr/dict/set example
var langs = [String]() // empty array
langs.append("Swift") // append an element at the end of the array
langs.append("Python")
var gpaStudent = [String:Float]() // empty dictionary
gpaStudent["Alice"] = 4.1
gpaStudent["Bob"] = 3.9
var letters = Set<Character>()
@MicrexIT
MicrexIT / IfStatement.swift
Created May 1, 2020 08:05
Swift Basics if
let name = "Bob"
if (name == "Bob") {
print("Hello, Bob 🙂")
} else {
print("Hello, you 😅")
}
print("Bye!")
// Prints Hello, Bob