First of All, we need CSR file to generate SSL certificate. When you have completed generating your CSR, cut/copy and paste it into the CSR field on the SSL certificate-request page. To Generate a Certificate Signing Request for Apache 2.x $ openssl …
Secure Apache with Let’s Encrypt on Ubuntu 14.04/16.04
Introduction This tutorial will show you how to set up a TLS/SSL certificate from Let’s Encrypt on an Ubuntu 14.04 server running Apache as a web server. SSL certificates are used within web servers to encrypt the traffic between the server and client, providing extra security for …
Sample code for sending push notifications
Please update the code a/c to requirements. Sample Code Please update if any better alternative.
Issue in file upload through PHP – cURL
Problem File not being uploaded on server through PHP – cURL Solution The CURLFile interface must be used to upload files. Code <?php $url = ‘http://192.168.1.94:5000/api/v1/upload-picture’; $img = ‘img/placeholder.png’; // Form-data $data_array = array( ‘id’ => 1, ‘picture_type’ => ‘user’, ‘file’ => new CurlFile($img) …
Change format of date/string like 5:00 to 05:00
-(NSString *)setDateInFormat:(NSString *)strTxt { NSArray *arr = [strTxt componentsSeparatedByString:@”:”]; NSString *str = [arr objectAtIndex:0]; if ([str length] < 2) { if (![str hasPrefix:@”0″]) { …
Compress image without changing image dimensions
We have to write a single line to compress the image at a time when we are uploading our image to a server. NSData *dataForPNGFile = UIImageJPEGRepresentation(imgPicked, 0.0f); 0.0f is the maximum & 1.0f is the minimum compress ratio we can change based on our …
Preventing Zoom in Phonegap + JQuery Mobile
Use Meta Tag with following property in HTML <meta name=”viewport” content=”width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=no” />
Remove text selection from PhoneGap iOS app
html { -webkit-user-select: none; }
Disable Emoji in input
$(‘input’).on(‘keypress’, function (event) { var regex = new RegExp(“[ -~]”); var key = String.fromCharCode(!event.charCode ? event.which : event.charCode); if (!regex.test(key)) { event.preventDefault(); return false; } });
Stop iOS Mobile from giving input buttons rounded corners and shade
we have to add css for this like as under input, textarea { -webkit-appearance: none; -webkit-border-radius: 0; }