This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
class ByteInfo { | |
class func GBFormatter(_ bytes: Int64) -> String { | |
let formatter = ByteCountFormatter() | |
formatter.allowedUnits = ByteCountFormatter.Units.useGB | |
formatter.countStyle = ByteCountFormatter.CountStyle.decimal | |
formatter.includesUnit = false | |
return formatter.string(fromByteCount: bytes) as String |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Be sure to run `pod lib lint ATLocationManager.podspec' to ensure this is a | |
# valid spec before submitting. | |
# | |
# Any lines starting with a # are optional, but their use is encouraged | |
# To learn more about a Podspec see https://guides.cocoapods.org/syntax/podspec.html | |
# | |
Pod::Spec.new do |spec| | |
spec.name = 'ATLocationManager' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"success":true,"message":"","data":{"common":{"categories":{"151":{"id_category":"151","name":"Arts & Humanities","image":"Arts.png","color":"FCAE52","seo_url":"arts-humanities","tag_line":"The Soul of Human Evolution","keywords":["manchester united 1"],"meta_title":"Manchester United (Football Club) 123213213","meta_description":"1321323213 1321321321 Manchester United (Football Club)Manchester United (Football Club)Manchester United (Football Club)Manchester United (Football Club)Manchester United (Football Club)Manchester United (Football Club)Manchester United (Football Club)Manchester United (Football Club)"},"152":{"id_category":"152","name":"Commerce","image":"Commerce.png","color":"689BA1","seo_url":"commerce","tag_line":"Money Matters","keywords":["real madrid 1"],"meta_title":"Real Madrid 12321321321312","meta_description":"342434 32432432 Real Madrid Real Madrid Real Madrid Real Madrid Real Madrid Real Madrid Real Madrid Real Madrid Real Madrid "},"153":{"id_category":"153","name":"Engg and Tech", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Network:NSObject, URLSessionDelegate, URLSessionTaskDelegate, URLSessionDataDelegate { | |
internal static let sharedInstance = Network() | |
fileprivate var networkParams:Array<NetworkParams> = Array() | |
fileprivate func networkCall(_ request:URLRequest, completionBlock:@escaping NetworkCompletionBlock) | |
{ | |
let configurationId = String(format: "Network%d", arc4random()) | |
let configuration = URLSessionConfiguration.background(withIdentifier: configurationId) | |
configuration.timeoutIntervalForRequest = request.timeoutInterval |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
final class MyClass { | |
private init() {} | |
private static var _shared: MyClass? | |
public static var shared: MyClass { | |
get { | |
if _shared == nil { | |
DispatchQueue.global().sync(flags: .barrier) { | |
if _shared == nil { | |
_shared = MyClass() | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.thakur.kafkaclient.service | |
import com.fasterxml.jackson.databind.JsonNode | |
import com.fasterxml.jackson.databind.ObjectMapper | |
import com.thakur.kafkaserver.model.Person | |
import org.apache.kafka.clients.consumer.ConsumerRecord | |
import org.slf4j.Logger | |
import org.slf4j.LoggerFactory | |
import org.springframework.kafka.annotation.KafkaListener | |
import org.springframework.stereotype.Component |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.thakur.kafkaclient.controller | |
import com.thakur.kafkaclient.service.KafkaService | |
import org.springframework.beans.factory.annotation.Autowired | |
import org.springframework.web.bind.annotation.GetMapping | |
import org.springframework.web.bind.annotation.RequestMapping | |
import org.springframework.web.bind.annotation.RestController | |
@RestController | |
@RequestMapping("kafka") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
spring: | |
cloud: | |
stream: | |
kafka: | |
binder: | |
brokers: localhost:9092 | |
spring.kafka.topic: test | |
spring.kafka.topic.groupId: testgroup |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.thakur.kafkaserver.restcontroller | |
import com.thakur.kafkaserver.model.Person | |
import com.thakur.kafkaserver.service.KafkaService | |
import org.springframework.http.HttpStatus | |
import org.springframework.web.bind.annotation.GetMapping | |
import org.springframework.web.bind.annotation.RequestMapping | |
import org.springframework.web.bind.annotation.ResponseStatus | |
import org.springframework.web.bind.annotation.RestController | |
import java.util.* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.thakur.kafkaserver.service | |
import com.thakur.kafkaserver.config.KafkaServerStreams | |
import com.thakur.kafkaserver.model.Person | |
import org.slf4j.Logger | |
import org.slf4j.LoggerFactory | |
import org.springframework.messaging.MessageHeaders | |
import org.springframework.messaging.support.MessageBuilder | |
import org.springframework.stereotype.Service | |
import org.springframework.util.MimeTypeUtils |
NewerOlder