Skip to content

Instantly share code, notes, and snippets.

View Bashta's full-sized avatar
🎯
Focusing

Erison Veshi Bashta

🎯
Focusing
  • Vlore
View GitHub Profile
@Bashta
Bashta / test.sol
Last active February 6, 2022 17:36
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=builtin&optimize=false&runs=200&gist=
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.7;
// MARK : ------------------------------------------------------------
// Defines the Main Contract Interface
contract Assignment {
// Actors partecipating in the contract. Entities in the real world
@Bashta
Bashta / test.sol
Created February 6, 2022 14:57
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=builtin&optimize=false&runs=200&gist=
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.7;
// Defines basic contract dependecies to initiate
contract MarkingSytem {
// State variables to hold the initial 3 marks
uint public mark1;
uint public mark2;
uint public mark3;
@Bashta
Bashta / test.sol
Created February 6, 2022 14:53
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=builtin&optimize=false&runs=200&gist=
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.7;
contract MarkingSytem {
// State variables to hold the initial 3 marks
uint public mark1;
uint public mark2;
uint public mark3;
// Flag to notify if first requirement is passed! "marks are with 10 pints of each other"
@Bashta
Bashta / test.sol
Created February 6, 2022 14:49
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=builtin&optimize=false&runs=200&gist=
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.7;
contract MarkingSytem {
// State variables to hold the initial 3 marks
uint public mark1;
uint public mark2;
uint public mark3;
// Flag to notify if first requirement is passed! "marks are with 10 pints of each other"
#!/bin/sh
#
if [ -e ".updated_build_number" ] ; then
rm ".updated_build_number"
fi
#!/bin/sh
#
if [ ! -e ".updated_build_number" ] ; then
touch ".updated_build_number"
perl -i -pe 'BEGIN{undef $/;} s/\t<key>CFBundleVersion<\/key>\n\t<string>\K(\d+)/$1+1/em' ./xxxx/xxxx/Info.plist
git add ./xxxxx/xxxxx/Info.plist
git commit --amend
func uploadDamageImage(imageData: Data, completion: @escaping UploadDamageImageCompletion) {
let url = "\(Config.shared.getBaseUrl())/api/images/damages"
print("Uploading damage image")
Alamofire.upload(multipartFormData: { multipartFormData in
multipartFormData.append(imageData, withName: "image", fileName: "dmg_image", mimeType: "image/jpg")
}, to: url,
method: .post,
encodingCompletion: { result in
private func updateState() {
// Make sure all the information is available
guard let rentalState = rentalState else {
self.state.value = .Unknown
return
}
let isPaymentInProgress = (paymentInProgress ?? false)
// Save whether address details should be shown before updating state
enum BookingState: Int, Comparable {
// Booking states, mapped from backend state together with check-in/out status and
// payment progress.
//
// NOTE: Should also include review status, which is currently not yet implemented
// on the backend.
case Started = 0
case CheckOutStarted = 1
@Bashta
Bashta / SnappCameraView.swift
Last active June 28, 2019 15:08
Basic implementation of camera scanner for rectangles.
//
// SnappCameraView.swift
// EdgeDetection
//
// Created by er on 11/4/17.
// Copyright (c) 2017 Erison Veshi
//
// 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