Skip to content

Instantly share code, notes, and snippets.

View Wassmd's full-sized avatar

Wasim Wassmd

View GitHub Profile
@Wassmd
Wassmd / FirstTestSpec.groovy
Created January 22, 2023 20:49
Spock Test
package com.paxier.currencyexchange.controller
import spock.lang.Specification
class FirstTestSpec extends Specification {
def "one plus one should be two"() {
expect:
1 + 1 == 2
}
@Wassmd
Wassmd / gist:e4d0cf099368695e0d3219633aeeeb14
Created June 24, 2020 04:01
Problem with Unowned in closure
import UIKit
class UnownedDemo {
func takeClosure(completion: @escaping () -> Void) {
DispatchQueue.main.asyncAfter(deadline: .now() + 5) {
completion()
}
}
}
import UIKit
class Widget {
let name: String
required init(name: String) {
self.name = name
}
}
func createWidget<T: Widget>(ofType: T.Type) -> T {
let widget = T.init(name: "Roq")
import UIKit
class BaseViewModel {
let service: String
init(service: String) {
self.service = service
}
//
// ViewController.swift
// ChainAnimation
//
// Created by Mohammed Wasimuddin on 14.01.20.
// Copyright © 2020 Wasim. All rights reserved.
//
import UIKit
@Wassmd
Wassmd / Future.dart
Created September 24, 2019 12:32
Async programming with Dart
import 'dart:io';
void main() {
performTasks();
}
void performTasks() async {
task1();
String output = await task2();
task3(output);
void main() {
// Methods
int result = calculator(1,2, multiply);
print(result);
// Class
Car lumbargini = Car(drive: driveFast);
@Wassmd
Wassmd / list.dart
Last active September 19, 2019 10:40
void main() {
List<String> myFamily = ['Roq', 'Marie', 'Ammu', 'Wasim'];
}