Skip to content

Instantly share code, notes, and snippets.

View raihan-uddin's full-sized avatar
🎯
Focusing

Md. Raihan Uddin raihan-uddin

🎯
Focusing
View GitHub Profile
@raihan-uddin
raihan-uddin / LICENCE SUBLIME TEXT
Created February 18, 2018 18:03
Sublime Text 3 Serial key build is 3143
## Sublime Text 3 Serial key build is 3103
—– BEGIN LICENSE —–
Michael Barnes
Single User License
EA7E-821385
8A353C41 872A0D5C DF9B2950 AFF6F667
C458EA6D 8EA3C286 98D1D650 131A97AB
AA919AEC EF20E143 B361B1E7 4C8B7F04
B085E65E 2F5F5360 8489D422 FB8FC1AA
@raihan-uddin
raihan-uddin / iso_4217_currency_codes.php
Created February 24, 2020 03:58 — forked from benedict-w/iso_4217_currency_codes.php
ISO 4217 currency codes as PHP array
<?php
// http://en.wikipedia.org/wiki/ISO_4217
return array(
'AFA' => array('Afghan Afghani', '971'),
'AWG' => array('Aruban Florin', '533'),
'AUD' => array('Australian Dollars', '036'),
'ARS' => array('Argentine Pes', '032'),
'AZN' => array('Azerbaijanian Manat', '944'),
@raihan-uddin
raihan-uddin / jquery_image_preload.js
Created February 24, 2020 03:58 — forked from benedict-w/jquery_image_preload.js
Simple jQuery Image Preload Extension
/**
* Simple jQuery Image Preloader Extension
*
* @param images = array source images to preload
* @param callback = optional function to execute when loaded
*/
$.fn.imagePreloader = function (images, callback) {
var deferreds = [];
$.each(images, function(i, src) {
deferreds.push(new $.Deferred(function (dfd) {
@raihan-uddin
raihan-uddin / read_files_from_dir.php
Created February 24, 2020 03:59 — forked from benedict-w/read_files_from_dir.php
PHP script to read files from a DIR parsing through a filename regex to match extensions
<?php
$files = array();
$folder = '../images';
$extensions = 'png';
if (is_dir($folder)){
$dir = opendir($folder);
while ($file = readdir($dir)) {
if (preg_match("/^[^\.].+\.{$extensions}$/i", $file)) {
@raihan-uddin
raihan-uddin / Remove URLs from string
Created March 14, 2020 09:36 — forked from vrushank-snippets/Remove URLs from string
PHP : Remove URLs from string
$fh = fopen("contacts.csv", "r");
while($line = fgetcsv($fh, 1000, ",")) {
echo "Contact: {$line[1]}";
}
@raihan-uddin
raihan-uddin / Parse CSV files
Created March 14, 2020 09:36 — forked from vrushank-snippets/Parse CSV files
PHP : Parse CSV files
$fh = fopen("contacts.csv", "r");
while($line = fgetcsv($fh, 1000, ",")) {
echo "Contact: {$line[1]}";
}
function contains($str, $content, $ignorecase=true){
if ($ignorecase){
$str = strtolower($str);
$content = strtolower($content);
}
return strpos($content,$str) ? true : false;
}
function extract_emails($str){
// This regular expression extracts all emails from a string:
$regexp = '/([a-z0-9_\.\-])+\@(([a-z0-9\-])+\.)+([a-z0-9]{2,4})+/i';
preg_match_all($regexp, $str, $m);
return isset($m[0]) ? $m[0] : array();
}
$test_string = 'This is a test string...
function GetBetween($content,$start,$end){
$r = explode($start, $content);
if (isset($r[1])){
$r = explode($end, $r[1]);
return $r[0];
}
return '';
}