Skip to content

Instantly share code, notes, and snippets.

View endy-s's full-sized avatar
🐺
Hunting challenges (and bugs)

Endy Silveira endy-s

🐺
Hunting challenges (and bugs)
  • Florianópolis
View GitHub Profile
@endy-s
endy-s / TableView Footer at Bottom.swift
Last active October 31, 2019 18:33
This code makes the TableView Footer be at the bottom of the screen if the cells doesn't fulfil the screen, and below the cells if it fills the screen
@endy-s
endy-s / StringTests.swift
Created May 23, 2019 18:35
Tests for the String extension to compare string versions
class StringTests: XCTestCase {
func testParseVersions() {
XCTAssertTrue("2.2.100-alpha".getRawVersionString()?.isVersion(lessThan:
"v2.3.2".getRawVersionString() ?? "0") ?? false)
XCTAssertTrue("v2.2.13".getRawVersionString()?.isVersion(lessThan:
"v2.4.16-37-geea723b-merck-blackhawk".getRawVersionString() ?? "0") ?? false)
XCTAssertTrue("v2.4.21-alpha".getRawVersionString()?.isVersion(lessThan:
"v2.4.22-103-g2f56154-trunk".getRawVersionString() ?? "0") ?? false)
XCTAssertTrue("v2.5.1-53-gded80545-dirty-jacob-uglydb".getRawVersionString()?.isVersion(lessThan:
@endy-s
endy-s / String.swift
Last active October 21, 2022 04:03
Compare two String Versions
extension String {
func getRawVersionString() -> String? {
return self.removePrefix("v")
.split(separator: "-")
.first?.toString()
}
// Modified from the DragonCherry extension - https://github.com/DragonCherry/VersionCompare
private func compare(toVersion targetVersion: String) -> ComparisonResult {
let versionDelimiter = "."
@endy-s
endy-s / android-kotlin-social-media-deep-links.md
Last active September 17, 2022 12:03
Android Kotlin - Methods to open social media apps using deep links
@endy-s
endy-s / URI.java
Last active September 17, 2017 00:12
URI Example - First Problem - Mão na Massa
import java.io.IOException;
import java.lang.System.*;
import java.util.Scanner;
/**
* Para se registrar no URI entre em https://www.urionlinejudge.com.br/judge/pt/register
*
* Os imports acima são necessários para:
* - Utilizar o System.out.println/printf para imprimir o resultado
* - Utilizar o Scanner para realizar a leitura das entradas do problema