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
const quickSort = (array, left = 0, right = array.length -1) => { | |
if (left >= right) { | |
return array; | |
} | |
const mid = Math.floor((left + right) / 2); | |
const pivot = array[mid]; | |
let newLeft = left; | |
let newRignt = right; | |
while (newLeft <= newRignt) { | |
while (array[newLeft] < pivot) { |
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
promises.reduce(async (prevProm, postProm) => { | |
await prevProm; | |
await postProm; | |
}, Promise.resolve()); |
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.content.Context; | |
import android.util.AttributeSet; | |
import android.util.Log; | |
import android.view.MotionEvent; | |
import android.view.ScaleGestureDetector; | |
public class ScaleCheckView extends View { | |
private ScaleGestureDetector scaleGestureDetector; |
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.app.Activity; | |
import android.app.Application; | |
import android.os.Bundle; | |
import androidx.annotation.NonNull; | |
import androidx.annotation.Nullable; | |
public class App extends Application { | |
private static App application; |
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 Foundation | |
import UIKit | |
class DetectJailBreak { | |
func hasJailbreak() -> Bool { | |
guard let cydiaUrlScheme = NSURL(string: "cydia://package/com.example.package") else { return false } | |
if UIApplication.shared.canOpenURL(cydiaUrlScheme as URL) { | |
return true |
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
@Override | |
public WebResourceResponse shouldInterceptRequest(WebView view, WebResourceRequest request) { | |
String resourceUrl = request.getUrl().toString(); | |
String fileExtension = WebViewResourceMappingHelper.getInstance().getFileExt(resourceUrl); | |
if(WebViewResourceMappingHelper.getInstance().getOverridableExtensions().contains(fileExtension)){ | |
String encoding = "UTF-8"; | |
String assetName = WebViewResourceMappingHelper.getInstance().getLocalAssetPath(resourceUrl); | |
if (!assetName.equals("")) { | |
String mimeType = WebViewResourceMappingHelper.getInstance().getMimeType(fileExtension); | |
if (!mimeType.equals("")) { |
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
webview.setOnLongClickListener(new View.OnLongClickListener() { | |
@Override | |
public boolean onLongClick(View v) { | |
return true; | |
} | |
}); | |
webview.setLongClickable(false); |
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
func webView(_ webView: WKWebView, didFinish navigation: WKNavigation!) { | |
let javascriptStyle = "var css = '*{-webkit-touch-callout:none;-webkit-user-select:none}'; var head = document.head || document.getElementsByTagName('head')[0]; var style = document.createElement('style'); style.type = 'text/css'; style.appendChild(document.createTextNode(css)); head.appendChild(style);" | |
webView.evaluateJavaScript(javascriptStyle, completionHandler: nil) | |
} |
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.app.Application; | |
import android.widget.Toast; | |
import java.io.BufferedReader; | |
import java.io.File; | |
import java.io.InputStreamReader; | |
public class App extends Application { | |
@Override |
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.content.Context; | |
import android.graphics.Rect; | |
import android.util.AttributeSet; | |
import android.widget.RelativeLayout; | |
public class KeyboardAwareLayout extends Viewgroup { | |
public KeyboardListener keyboardListener = null; | |
private Rect rect = new Rect(); |