Skip to content

Instantly share code, notes, and snippets.

View Rushabhgedam's full-sized avatar
🎯
Focusing

Rushabh Gedam Rushabhgedam

🎯
Focusing
View GitHub Profile
@Rushabhgedam
Rushabhgedam / NoInternetConnection.tsx
Last active February 28, 2024 02:49
NoInternetConnection.tsx
// Add required imports here...
export class NoInternetConnection extends React.Component<any, any, any> {
ribbonHeight: Animated.Value;
constructor(props: any) {
super(props);
this.ribbonHeight = new Animated.Value(0);
}
componentDidUpdate(prevProps: { isConnected: any; }) {
{
"scripts:{
"cleanBuild": "adb uninstall com.learnmagica.oteapp && cd android && gradlew clean && cd .. && react-native run-android",
"cleanReleaseBuild": "adb uninstall com.learnmagica.oteapp && cd android && gradlew clean && cd .. && react-native run-android --variant=release",
"updateAndroidIndex": "react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res"
}
}
#cloud-config
bootcmd:
- cloud-init-per always fix_broken_ufw_1 sh -xc "sudo chown root:root /home >> /var/tmp/svc_$INSTANCE_ID 2>&1 || true"
- cloud-init-per always fix_broken_ufw_1 sh -xc "sudo chmod 755 /home >> /var/tmp/svc_$INSTANCE_ID 2>&1 || true"
- cloud-init-per always fix_broken_ufw_1 sh -xc "sudo chown ubuntu:ubuntu /home/ubuntu -R >> /var/tmp/svc_$INSTANCE_ID 2>&1 || true"
- cloud-init-per always fix_broken_ufw_1 sh -xc "sudo chmod 700 /home/ubuntu /home/ubuntu/.ssh >> /var/tmp/svc_$INSTANCE_ID 2>&1 || true"
- cloud-init-per always fix_broken_ufw_1 sh -xc "sudo chmod 600 /home/ubuntu/.ssh/authorized_keys >> /var/tmp/svc_$INSTANCE_ID 2>&1 || true"
webViewQuestionData.post(new Runnable() {
@Override
public void run() {
webViewQuestionData.loadUrl("javascript:(function clearRadioBtn() { let radioList = document.getElementsByTagName(\"input\");\n" +
"for(let i = 0; i < radioList.length; i++){\n" +
" if(radioList[i].type = \"radio\"){\n" +
" if(radioList[i].checked)\n" +
" radioList[i].checked = false \n" +
" }\n" +
"} } )()"
fetchData(mobile_number) {
try {
NetInfo.fetch().then(async (isConnected) => {
//this.changeLoadingStatus(true)
if (isConnected) {
let url = Webservice_URL + "todaysLeads?mobileNo=" + mobile_number;
let data = await performApiCall(url, "GET", {})
this.onFetchComplete(data)
}
});
let _headers = {
'Content-Type': 'application/json',
"accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,/;q=0.8,application/signed-exchange;v=b3;q=0.9,application/json",
}
export function performApiCall(url, method, requestBody) {
let body, responseStatus
let request = {
method: method,
headers: _headers
import threading
import pyautogui
def startsending():
threading.Timer(0.6, startsending).start()
pyautogui.keyDown("ctrl")
pyautogui.keyDown("v")
pyautogui.keyUp("v")
pyautogui.keyUp("ctrl")
pyautogui.keyDown("enter")
import java.security.KeyManagementException;
import java.security.NoSuchAlgorithmException;
import java.security.SecureRandom;
import java.security.cert.X509Certificate;
import javax.net.ssl.HostnameVerifier;
import javax.net.ssl.HttpsURLConnection;
import javax.net.ssl.SSLContext;
import javax.net.ssl.SSLSession;
import javax.net.ssl.TrustManager;
import React from 'react';
import {Dimensions} from 'react-native';
const {width, height} = Dimensions.get('window');
const percentHeight = height / 100;
const percentWidth = width / 100;
export const sizeWidth = (percent) => {
return percent * (percentWidth < percentHeight ? percentWidth : percentHeight);
function TextLine(props) {
const { title, subTitle, style } = props;
return (
<View style={style}>
<Text h6 third h6Style={{ marginBottom: 5 }}>
{subTitle}
</Text>
<Text h4 medium>
{title}
</Text>