Skip to content

Instantly share code, notes, and snippets.

View lazzyms's full-sized avatar
👨‍💻

Maulik Sompura lazzyms

👨‍💻
View GitHub Profile
@lazzyms
lazzyms / README.md
Last active July 28, 2020 15:44
Interview Question - the perfect curry

We want to prepare the perfect curry with ingredients P, Q, and R. "A" is a zero-indexed array of N integers. Elements of A are integers within the range [−99,999,999 to 99,999,999] The curry is a string consisting of N characters such that each character is either P, Q, or R and the corresponding index of the array is the weight of each ingredient. The curry is perfect if the sum of the total weights of P, Q, and R is equal. Write a function function makeCurry(Array); such that, given a zero-indexed array Array consisting of N integers, returns the perfect curry of this array. The function should return the string "noLuck" if no perfect curry exists for that Array.

@pmkay
pmkay / installing-postman.md
Created April 27, 2020 02:49 — forked from ba11b0y/installing-postman.md
Installing Postman on Ubuntu/Gnome

Since Chrome apps are now being deprecated. Download postman from https://dl.pstmn.io/download/latest/linux

Although I highly recommend using a snap

sudo snap install postman

Installing Postman

tar -xzf Postman-linux-x64-5.3.2.tar.gz
@imanilchaudhari
imanilchaudhari / PHP Version Manager On Ubuntu 18.04
Created November 20, 2018 05:23
PHP Version Manager On Ubuntu 18.04
Get the information of PHP
==========================
$ sudo apt show php
OR
$ sudo apt show php -a
$ sudo apt install php // this will install default php version ( may be 7.2 )
T0 Install Different Versions Of PHP
@ywwwtseng
ywwwtseng / host-react-app-on-apache-server.md
Last active October 28, 2024 19:15
Host react application on Apache server

Host react application on Apache server

Step 1 : Create your app

$ npm install -g create-react-app 
$ create-react-app my-app

Step 2 : Build it for production

@rmpel
rmpel / apache_request_headers.php
Last active June 11, 2022 09:30
apache_request_headers drop-in function for PHP as FPM
<?php
// Drop-in replacement for apache_request_headers() when it's not available
if ( ! function_exists( 'apache_request_headers' ) ) {
function apache_request_headers() {
static $arrHttpHeaders;
if ( ! $arrHttpHeaders ) {
// Based on: http://www.iana.org/assignments/message-headers/message-headers.xml#perm-headers
$arrCasedHeaders = array(
@tomysmile
tomysmile / mac-setup-redis.md
Last active October 31, 2024 21:46
Brew install Redis on Mac

type below:

brew update
brew install redis

To have launchd start redis now and restart at login:

brew services start redis
@mrtns
mrtns / gist:78d15e3263b2f6a231fe
Last active September 20, 2024 17:28
Upgrade Chrome from Command Line on Ubuntu
# Install
# via http://askubuntu.com/questions/510056/how-to-install-google-chrome
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
sudo sh -c 'echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list'
sudo apt-get update
sudo apt-get install google-chrome-stable
# Update
@PeloNZ
PeloNZ / instructions
Created March 25, 2014 00:42
ssd caching setup for ubuntu
= ssd cache setup=
I got a new pc with an SSD and a spinner disk. Having to decide exactly what I think I needed on the SSD was hard. Why not try using it as a caching device?
==Why use ssd caching?==
* Intel's "Smart Response Technology" on Windows 7 is awesome
* SSD wear can be reduced
* The ssd use can be optimized automagically
* No compromise on free space on ssd vs empty space on hdd
===What runs slow normally for me?===
@6174
6174 / Random-string
Created July 23, 2013 13:36
Generate a random string in JavaScript In a short and fast way!
//http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript
Math.random().toString(36).substring(2, 15) + Math.random().toString(36).substring(2, 15);
@IngmarBoddington
IngmarBoddington / .htaccess
Created March 24, 2013 21:07
All sorts of .htaccess fixes, redirects and security related settings
#Front Controller rewrite
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^.*$ index.php [L,NC]
# Ensure we are using HTTPS
RewriteCond %{HTTPS} !on
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]