Skip to content

Instantly share code, notes, and snippets.

View codedeman's full-sized avatar
👋
Work Hard

Kevin codedeman

👋
Work Hard
View GitHub Profile
func run(completion:@escaping()->Void) {
DispatchQueue.main.async {
completion()
}
}
@codedeman
codedeman / swift
Created July 27, 2019 09:19
loadImagefromurl
func loadImage(urlString1:String,urlString2:String) {
DispatchQueue.global().async {
let url1 = URL(string: urlString1)
let url2 = URL(string: urlString2)
guard let data1 = try? Data(contentsOf: url1!) else {return}
guard let data2 = try? Data(contentsOf: url2!) else {return}
self.dispatchGroup.enter()
func displayUser() {
print("reloading data")
}
@IBAction func updateButton(_ sender: Any) {
loadImage(urlString1: urlString1, urlString2: urlString2)
dispatchGroup.notify(queue: .main) {
self.displayUser()
}
@IBAction func updateButton(_ sender: Any) {
loadImage(urlString1: urlString1, urlString2: urlString2)
dispatchGroup.notify(queue: .main) {
self.displayUser()
}
}
@codedeman
codedeman / java
Created August 9, 2019 07:53
count word
import java.util.Scanner;
public class ChainTest {
int count = 0;
public static final char SPACE = ' ';
public static final char TAB = '\t';
public static final char BREAK_LINE = '\n';
@codedeman
codedeman / java
Created August 9, 2019 07:53
count word
import java.util.Scanner;
public class ChainTest {
int count = 0;
public static final char SPACE = ' ';
public static final char TAB = '\t';
public static final char BREAK_LINE = '\n';
@codedeman
codedeman / shallowcopy
Created August 12, 2019 08:43
The Prototype Pattern
class Location{
var name:String = ""
var address:String = ""
init(name:String,address:String) {
self.name = name
self.address = address
}
{
"name": "Back-endAppTracking",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"start": "node src/index.js",
"dev": "nodemon src/index.js"
},
"keywords": [],
@codedeman
codedeman / scrollView
Created March 18, 2020 10:35
layoutwithcode
//
// HomeVC.swift
// Animation-Research
//
// Created by Ominext on 3/18/20.
// Copyright © 2020 Ominext. All rights reserved.
//
import UIKit
import SnapKit