Skip to content

Instantly share code, notes, and snippets.

View mjm918's full-sized avatar
🍻
Code & Chill

Mohammad Julfikar mjm918

🍻
Code & Chill
View GitHub Profile
@mjm918
mjm918 / client.py
Last active May 6, 2024 11:55
Python Encryption Decryption (Socket Chat,RSA Encryption/Decryption,AES.MODE_CTR encryption.IDEA.MODE_CTR Encryption/Decryption)
import time
import socket
import threading
import hashlib
import itertools
import sys
from Crypto import Random
from Crypto.PublicKey import RSA
from CryptoPlus.Cipher import IDEA
@mjm918
mjm918 / class.CreateReadUpdate.php
Last active April 3, 2020 11:49
PHP MySQL Object Oriented Programming
<?php
require_once(dirname(__FILE__).'/class.MySQL.php');
class CreateReadUpdate extends MySQL{
public function __construct(){
parent::__construct();
}
@mjm918
mjm918 / client.py
Created December 15, 2018 09:56
Python socket programming AES CBC encryption
import socket
import os
import threading
import hashlib
from Crypto import Random
import Crypto.Cipher.AES as AES
from Crypto.PublicKey import RSA
import signal
from lazyme.string import color_print
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8">
<title></title>
</head>
<body>
<form action="PATH_TO_vimigo.php" method="get">
<input type="text" name="date_from" value="2019-01-10">
<input type="text" name="date_to" value="2019-02-22">
@mjm918
mjm918 / XMLHttpRequest.js
Last active March 1, 2019 03:47
Vimigo Code Samples
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
console.log(JSON.stringify(this.responseText));
}
};
xhttp.open("GET", "LINK_TO_EASYTECH_API?date_from=2019-01-10&date_to=2019-02-22&auth=TOKEN", true);
xhttp.send();
@mjm918
mjm918 / sync.js
Created March 1, 2019 03:56
Xilnex sync
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
console.log(JSON.stringify(this.responseText));
}
};
xhttp.open("GET", "LINK_TO_EASYTECH_API?auth=TOKEN", true);
xhttp.send();
@mjm918
mjm918 / DownloadManager.h
Created May 22, 2019 05:01
Handy solution to *joltup/rn-fetch-blob* iOS parallel download broken problem
//
// DownloadManager.h
//
// Created by Mohammad Julfikar on 22/05/2019.
// Copyright © 2019 Facebook. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "RCTBridgeModule.h"
@mjm918
mjm918 / ServerReachable.js
Last active March 11, 2024 02:19
React Native check if server is reachable. Sometimes the device shows that you are connected to internet but when you make a request to your server, you dont get any response. This handy code will ping a server and wait for response, if no response, it will alert the user. You can use this code on top of your fetch function. It will run in paral…
export const isReachable = async () =>{
const timeout = new Promise((resolve, reject) => {
setTimeout(reject, 5000, 'Request timed out');
});
const request = fetch('https://xxxxxx.com');
try {
const response = await Promise
.race([timeout, request]);
return true;
}
@mjm918
mjm918 / SpeedTest.js
Created July 16, 2019 12:36
React native check internet speed
export const fetchParallel = (link,header, callback) =>{
const POOR = 150;
const MODERATE = 550;
const GOOD = 2000;
const _start = new Date().getTime();
const speedTester = RNFetchBlob
.config({
@mjm918
mjm918 / Banner.h
Last active September 11, 2019 13:19
React Native Banner View (Android & iOS native module)
//
// Banner.h
//
// Created by Mohammad Julfikar on 08/09/2019.
// Copyright © 2019 Facebook. All rights reserved.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN