This file contains hidden or 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 android.graphics.Bitmap; | |
import android.graphics.BitmapFactory; | |
import android.media.MediaMetadataRetriever; | |
import android.os.AsyncTask; | |
import android.os.Environment; | |
import android.widget.ImageView; | |
import org.apache.commons.io.FilenameUtils; |
This file contains hidden or 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
<key>NSAppTransportSecurity</key> | |
<dict> | |
<key>NSAllowsArbitraryLoads</key> | |
<true/> | |
</dict> |
This file contains hidden or 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
private void getFeeds() { | |
if (mRetrofit == null){ | |
mRetrofit = RestClient.getClient(); | |
} | |
apiInterface = mRetrofit.create(ApiInterface.class); | |
Call<FeedResponse> call = apiInterface.getFeed(Initializer.readFromPreferences(getContext(), Constants.SPKeys.authTokenKey,"")); | |
call.enqueue(new retrofit2.Callback<FeedResponse>() { | |
@Override | |
public void onResponse(Call<FeedResponse> call, Response<FeedResponse> response) { |
This file contains hidden or 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
{ | |
var address : String? | |
// Get list of all interfaces on the local machine: | |
var ifaddr : UnsafeMutablePointer<ifaddrs>? | |
guard getifaddrs(&ifaddr) == 0 else { return nil } | |
guard let firstAddr = ifaddr else { return nil } | |
// For each interface ... | |
for ifptr in sequence(first: firstAddr, next: { $0.pointee.ifa_next }) { |
This file contains hidden or 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
// | |
// ImageExt.swift | |
// Dabbagul | |
// | |
// Created by Hemant Singh on 06/05/17. | |
import Foundation | |
import Alamofire | |
extension UIImageView { | |
var documentsUrl: URL { |
This file contains hidden or 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
class Solution { | |
func letterCombinations(_ digits: String) -> [String] { | |
let phone: [String: String] = ["2": "abc", "3": "def", "4": "ghi", "5": "jkl", "6": "mno", "7": "pqrs", "8": "tuv", "9": "wxyz"] | |
var output: [String] = [] | |
func backTrack(combination: String, next_digits: String) { | |
if next_digits.count == 0 { | |
output.append(combination) | |
} else { | |
let digit = String(next_digits[next_digits.startIndex..<next_digits.index(next_digits.startIndex, offsetBy: 1)]) | |
let letters: String = phone[digit] ?? "" |
OlderNewer