Skip to content

Instantly share code, notes, and snippets.

@matiullah31
matiullah31 / gist:aa72cf1b66d691feffc418d63240f711
Created July 17, 2020 20:40 — forked from maccath/gist:3981205
Split PDF to individual pages using FPDI and FPDF
<?php
/**
* Split PDF file
*
* <p>Split all of the pages from a larger PDF files into
* single-page PDF files.</p>
*
* @package FPDF required http://www.fpdf.org/
* @package FPDI required http://www.setasign.de/products/pdf-php-solutions/fpdi/
@matiullah31
matiullah31 / gist:4dc8287ab76cc09bd3b58b42858a61fa
Created July 17, 2020 20:40 — forked from silasrm/gist:3da655045b899a858eae4f4463755f5c
Split PDF to individual pages using FPDI and FPDF
<?php
/**
* Split PDF file
*
* <p>Split all of the pages from a larger PDF files into
* single-page PDF files.</p>
*
* @package FPDF required http://www.fpdf.org/
* @package FPDI required http://www.setasign.de/products/pdf-php-solutions/fpdi/
@matiullah31
matiullah31 / create_and_download_zip.php
Created July 15, 2020 07:10 — forked from sohelrana820/create_and_download_zip.php
Create and download ZIP file in PHP
<?php
/**
* @author: Sohel Rana <me.sohelrana@gmail.com>
* @author URI: http://sohelrana.me
* @description: Create zip file and download in PHP
*/
function createZipAndDownload($files, $filesPath, $zipFileName)
{
// Create instance of ZipArchive. and open the zip folder.
@matiullah31
matiullah31 / build-zip-from-s3.php
Created July 15, 2020 07:08 — forked from jeremeamia/build-zip-from-s3.php
Create a zip from objects from S3.
<?php
// These are just the basics for how to do this. Notes:
// - Not fully tested.
// - Not suitable for production.
// - May not work well if large ammounts of data.
// - Requires AWS SDK for PHP and http://php.net/manual/en/book.zip.php
require '/path/to/sdk-or-autoloader';
@matiullah31
matiullah31 / nginx-tuning.md
Created July 9, 2020 10:39 — forked from denji/nginx-tuning.md
NGINX tuning for best performance

Moved to git repository: https://github.com/denji/nginx-tuning

NGINX Tuning For Best Performance

For this configuration you can use web server you like, i decided, because i work mostly with it to use nginx.

Generally, properly configured nginx can handle up to 400K to 500K requests per second (clustered), most what i saw is 50K to 80K (non-clustered) requests per second and 30% CPU load, course, this was 2 x Intel Xeon with HyperThreading enabled, but it can work without problem on slower machines.

You must understand that this config is used in testing environment and not in production so you will need to find a way to implement most of those features best possible for your servers.

using System;
namespace RsaKeyConverter.Converter
{
public static class BytesExtensions
{
public static string ToBase64(this byte[] bytes)
{
return Convert.ToBase64String(bytes);
}
<?php
// generate private/public key as follows:
// > openssl genrsa -out private.pem 2048
// > openssl rsa -in private.pem -outform PEM -pubout -out public.pem
$data = "String to encrypt";
$privKey = openssl_pkey_get_private('file:///path/to/private.pem');
$encryptedData = "";
@matiullah31
matiullah31 / List.md
Created May 1, 2020 06:59 — forked from msurguy/List.md
List of open source projects made with Laravel

Other people's projects:

My projects (tutorials are on my blog at http://maxoffsky.com):

@matiullah31
matiullah31 / curl-get.php
Created March 6, 2020 05:22 — forked from lesstif/curl-get.php
PHP CURL POST example
<?php
$url = 'http://google.com';
if ($argc > 1){
$url = $argv[1];
}
$ch=curl_init();
// user credencial
@matiullah31
matiullah31 / Activate Office 2019 for macOS VoL.md
Created November 13, 2019 12:11 — forked from zthxxx/Activate Office 2019 for macOS VoL.md
crack activate office on mac with license file

Activate MS Office 2019/2016 for macOS - Microsoft_Office_2019_VL_Serializer

Office 2019 above

2019-06-03

Note that Office2019 DO NOT support activate via simple copy/paste plist license file which is the simplest way to activate Office 2016. Fortunately, you can also use the VL Serializer tool, just install Office 2019 and Serializer, then run Serializer to activate.

Ref