Skip to content

Instantly share code, notes, and snippets.

View rajeshstarlite's full-sized avatar

Rajesh Kaswala rajeshstarlite

View GitHub Profile
@rajeshstarlite
rajeshstarlite / 1. Building PHP-MAMP on Apple Silicon M1.md
Created May 3, 2021 06:58 — forked from lennardv2/1. Building PHP-MAMP on Apple Silicon M1.md
Native PHP development / MAMP stack on Apple silicon M1

Building the MAMP stack (php, apache & mysql) on Apple Silicon ARM (native)

In this tutorial, we'll build the the nescessary packages for ARM via homebrew. After that we'll configure apache2 for using virtual hosts. The native php is ofcourse way faster, see the results of this benchmark below.

TEST NAME SECONDS OP/SEC
Rosetta2 191.654 sec 1.96 MOp/s
Intel i7-4790K (imac 2014) 156.791 sec 2.39 MOp/s
Intel i5-8500B (mini 2018) 141.381 sec 2.65 MOp/s
ARM m1 43.745 sec 8.58 MOp/s
@rajeshstarlite
rajeshstarlite / media-query.css
Created October 27, 2018 05:34 — forked from gokulkrishh/media-query.css
CSS Media Queries for Desktop, Tablet, Mobile.
/*
##Device = Desktops
##Screen = 1281px to higher resolution desktops
*/
@media (min-width: 1281px) {
//CSS
@rajeshstarlite
rajeshstarlite / subdirectory-uploads.md
Created May 1, 2017 07:23
WordPress: Create new sub directory in the uploads directory

WordPress: Create new sub directory in the uploads directory

Some times it's required to create folder inside the /uploads/ directory of WordPress. WP Codex function wp_mkdir_p() comes to rescue you. Let's say you want to create a folder StarLite inside the /uploads/ directory then below is code:

$your_folder_name = 'StarLite';
$upload_dir = wp_upload_dir(); 
$your_folder = $upload_dir['basedir'] . '/' . $your_folder_name;
if(!file_exists($your_folder)) wp_mkdir_p($your_folder);