Skip to content

Instantly share code, notes, and snippets.

View shahalom's full-sized avatar

Shah Alom shahalom

View GitHub Profile
@shahalom
shahalom / css-grid-example.html
Last active May 24, 2023 19:28
Grid layout example with css grid
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Grid layout with css grid</title>
<style>
.wrap {
padding: 2rem;
@shahalom
shahalom / LAMP install steps.bash
Last active January 22, 2022 16:03
One by one steps to Install LAMP (with multiple PHP versions) in a fresh new UBUNTU operating system
Step 1: Update your distro
=> `$ sudo apt update`
Step 2: Add Repository and again update your distro
=> `$ sudo add-apt-repository ppa:ondrej/php`
Step 3: Install Apache2
=> `$ sudo apt install apache2`
Step 4: Here I am going to install PHP php5.6 and php7.4 versions
<?php
#!/usr/bin/env php
//usage: php envato-screenshots-downloader.php /path/to/save/screenshots http://url/to/screenshots/page
set_time_limit(0);
$dir = $argv[1];
$source = $argv[2];
print_r($argv);
mkdir ($dir);
$src = file_get_contents($source);
$pattern = '/src="(https:\/\/0.s3[a-zA-Z0-9_\-\.\/%]+)"/i';
<?php
/**
* Simple excel writer class with no external dependencies, drop it in and have fun
* @author Matt Nowack
* @license Unlicensed
* @version 1.0
*/
class Excel {
private $col;
@shahalom
shahalom / digit.validation.js
Created February 26, 2013 11:39
validating numeric or number values from form element
/*!
* @author: Shah Alom
* @website: http://tutpub.com/
*/
//Check Number Value. For ex: 123.10 or +123.10
jQuery.fn.isNumber = function(){
str = $(this).val();
var myPattern = /^\s*(\+|-)?((\d+(\.\d\d)?)|(\.\d\d))\s*$/;// Check if string is numeric +123

Awesome PHP Libraries

A list of amazingly awesome PHP libraries that you should consider using (and some other shiny extras).