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

Activate Windows 8, 8.1, 10 and 11 Pro for Free

A guide how to get and activate Windows 8, 8.1, 10 and 11 Pro for free!

NOTE

If you see the Windows keyboard button in this guide; and you can't find it on your keyboard, you likely have/had Windows 10 which has the button . If you can't find that one, you likely have a PC that has been upgraded to Windows 8/8.1/10/11 from Windows 8.1/8/7/Vista/XP and other ones. If you have one of those, refer the Windows key button to as yours. A list of them is below:

Windows key buttons

- Windows 11

- Windows 10

@raihan-uddin
raihan-uddin / How-to.md
Created January 20, 2021 04:57 — forked from ux-powered/How-to.md
Deploy a Laravel-Vue project to a subdirectory

The guide how to deploy a Laravel-Vue project to a subdirectory.

Let's assume we want to deploy our app to http://example.com/projects/laravel-vue-demo/. Here's what you will need to do:

  1. Add the next keys to your .env config:
APP_PUBLIC_PATH=
VUE_PUBLIC_PATH=/
@raihan-uddin
raihan-uddin / active_record.md
Created October 27, 2020 09:52 — forked from yesnik/active_record.md
Yii 1 Framework Cookbook

CActiveRecord methods

findAll()

Sort records

// Ascending order
Partner::model()->findAll(array('order' => 'company'));
function generatePassword($length=9, $strength=0) {
$vowels = 'aeuy';
$consonants = 'bdghjmnpqrstvz';
if ($strength >= 1) {
$consonants .= 'BDGHJLMNPQRSTVWXZ';
}
if ($strength >= 2) {
$vowels .= "AEUY";
}
if ($strength >= 4) {
@raihan-uddin
raihan-uddin / Detect location by IP
Created March 14, 2020 09:43 — forked from vrushank-snippets/Detect location by IP
PHP : Detect location by IP
function detect_city($ip) {
$default = 'UNKNOWN';
if (!is_string($ip) || strlen($ip) < 1 || $ip == '127.0.0.1' || $ip == 'localhost')
$ip = '8.8.8.8';
$curlopt_useragent = 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2) Gecko/20100115 Firefox/3.6 (.NET CLR 3.5.30729)';
$url = 'http://ipinfodb.com/ip_locator.php?ip=' . urlencode($ip);
@raihan-uddin
raihan-uddin / Unzip zip files
Created March 14, 2020 09:43 — forked from vrushank-snippets/Unzip zip files
PHP : Unzip zip files
function unzip_file($file, $destination){
// create object
$zip = new ZipArchive() ;
// open archive
if ($zip->open($file) !== TRUE) {
die (’Could not open archive’);
}
// extract contents to destination directory
$zip->extractTo($destination);
// close archive
$fileContents = file_get_contents('http://webdevelopergeeks.com/demo/sms.xml');
$fileContents = str_replace(array("\n", "\r", "\t"), '', $fileContents);
$fileContents = trim(str_replace('"', "'", $fileContents));
$simpleXml = simplexml_load_string($fileContents);
$json = json_encode($simpleXml);
<?php
function arrayToXml($array, $rootElement = null, $xml = null) {
$_xml = $xml;
if ($_xml === null) {
$_xml = new SimpleXMLElement($rootElement !== null ? $rootElement : '<root><root/>');
}
foreach ($array as $k => $v) {
/**
* Generating CSV formatted string from an array.
*/
function array_to_csv($array, $header_row = true, $col_sep = ",", $row_sep = "\n", $qut = '"')
{
if (!is_array($array) or !is_array($array[0])) return false;
//Header row.
if ($header_row)
{
$fileName = 'Billing-Summary.csv';
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header('Content-Description: File Transfer');
header("Content-type: text/csv");
header("Content-Disposition: attachment; filename={$fileName}");
header("Expires: 0");
header("Pragma: public");
$fh = @fopen( 'php://output', 'w' );