Skip to content

Instantly share code, notes, and snippets.

Gianluca Tranchedone gtranchedone

Block or report user

Report or block gtranchedone

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View keybase.md

Keybase proof

I hereby claim:

  • I am gtranchedone on github.
  • I am gtranchedone (https://keybase.io/gtranchedone) on keybase.
  • I have a public key ASAcsJeDWnxlG38poeOC7M06w9o_fObAWMB5icYKqj-IBgo

To claim this, I am signing this object:

@gtranchedone
gtranchedone / jwtRS256.sh
Created Jul 29, 2018 — forked from ygotthilf/jwtRS256.sh
How to generate JWT RS256 key
View jwtRS256.sh
ssh-keygen -t rsa -b 4096 -f jwtRS256.key
# Don't add passphrase
openssl rsa -in jwtRS256.key -pubout -outform PEM -out jwtRS256.key.pub
cat jwtRS256.key
cat jwtRS256.key.pub
@gtranchedone
gtranchedone / UI Testing.md
Last active Mar 5, 2018
Guidelines for UI Testing
View UI Testing.md

What is UI Testing?

In software engineering, graphical user interface testing is the process of testing a product's graphical user interface to ensure it meets its specifications. This is normally done through the use of a variety of test cases.

-- Wikipedia

UI Testing (also know as End-to-End Testing, or sometimes Integration Testing) helps with two aspects of software development:

  • Regression Testing: to ensure that all possible user journeys - especially the edge cases, or for rarely visited screens - consistently funcion correctly across releases.
  • New features development: to help determine 1. the minimum amount of work to be done to implement the feature, 2. that the new feature functions correctly, 3. helps ensuring the app is more accessible for people with disabilities. Moreover, done during development, UI Testing ensures immediate regression testing exposure.
@gtranchedone
gtranchedone / VaporRespond.swift
Created May 30, 2017
Respond to different requests in Vapor
View VaporRespond.swift
public func respond(to request: Request, with responses: [ContentType : ResponseRepresentable]) throws -> ResponseRepresentable {
let contentType: ContentType
let _ = request.accept.prefers("html")
if let header = request.accept.first {
var requestedContentType = ContentType.from(string: header.mediaType)
if requestedContentType == .any {
if let requestContentType = request.contentType {
requestedContentType = ContentType.from(string: requestContentType)
}
else {
@gtranchedone
gtranchedone / Package.swift
Created Feb 20, 2017
Testing Server Side Swift Apps - Package Manifesto
View Package.swift
import PackageDescription
let package = Package(
name: "VaporApp",
targets: [
Target(name: "Executable", dependencies: ["App"])
],
dependencies: [
.Package(url: "https://github.com/vapor/vapor.git", majorVersion: 1, minor: 5)
],
@gtranchedone
gtranchedone / PostsController.swift
Created Feb 20, 2017
Testing Server Side Swift Apps - PostsControllerTests (Basic)
View PostsController.swift
import XCTest
@testable import App
class PostsControllerTests: XCTestCase {
func testExample() {
XCTAssertTrue(true)
}
}
@gtranchedone
gtranchedone / LinuxMain.swift
Last active Feb 20, 2017
Testing Server Side Swift Apps - LinuxMain
View LinuxMain.swift
import XCTest
@testable import AppTests
XCTMain([
testCase(PostsControllerTests.allTests),
])
View Auto Layout Example: Springs and Struts.swift
// A view containing stacked title and message labels
// The labels have flexible width that changes accordingly to this view's size changes
class SomeView: UIView {
let titleLabel: UILabel
let messageLabel: UILabel
// ...other subviews
@gtranchedone
gtranchedone / Auto Layout Example: Manual Layout.swift
Last active Jan 7, 2017
Auto Layout Example: Manual Layout
View Auto Layout Example: Manual Layout.swift
// A view containing stacked title and message labels
// The entire layout is manually calculated every time the view has to be rendered or it's requested to re-layout
class SomeView: UIView {
let titleLabel = UILabel(frame: .zero)
let messageLabel = UILabel(frame: .zero)
// ...other subviews
@gtranchedone
gtranchedone / VaporRoutes.swift
Created Nov 26, 2016
Vapor Routes Command Helper
View VaporRoutes.swift
import Console
import Routing
import HTTP
class FakeRouter: RouteBuilder {
public typealias Host = String
public typealias Method = String
public typealias Output = HTTP.Responder
private let console: Terminal
You can’t perform that action at this time.