Skip to content

Instantly share code, notes, and snippets.

View sohelrana820's full-sized avatar
💭
I may be slow to respond.

Sohel Rana sohelrana820

💭
I may be slow to respond.
View GitHub Profile
@sohelrana820
sohelrana820 / phpunit.xml
Created July 18, 2018 04:07
PHPUNIT.XML configuration for CakePHP 3
<?xml version="1.0" encoding="UTF-8"?>
<phpunit
colors="true"
processIsolation="false"
stopOnFailure="false"
syntaxCheck="false"
bootstrap="./tests/bootstrap.php"
backupGlobals="true"
>
@sohelrana820
sohelrana820 / fork forced sync
Created July 15, 2018 19:34 — forked from glennblock/fork forced sync
Force your forked repo to be the same as upstream.
git fetch upstream
git reset --hard upstream/master
@sohelrana820
sohelrana820 / oAuth_login.js
Last active August 10, 2017 14:00
oAuth_login.js
<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script>
var authorizeUrl = 'http://example.com/oauth/authorize?';
var accessTokenValidatorUrl = 'http://example.com/user-info';
var scope = 'basic email';
var clientId = 'client_id';
var redirectUrl = 'http://localhost:8081';
@sohelrana820
sohelrana820 / using-cakephp-logging-scope.php
Created August 3, 2017 10:27
Implementing CakePHP Logging Scope
<?php
/**
* @author: Sohel Rana <me.sohelrana.me>
* @author URI: http://blog.sohelrana.me
* @licence; MIT
* @link: https://blog.sohelrana.me/using-cakephp-logging-scope
*
* Implementing CakePHP Logging Scope
*/
@sohelrana820
sohelrana820 / app.yaml
Created August 1, 2017 13:35 — forked from darktable/app.yaml
GAE: App.yaml designed for serving a static site on Google App Engine (Python). Copy your static html and files into a folder called "static" next to app.yaml. Contains a bunch of mimetype declarations from html5boilerplate's .htaccess. May not be neces
application: you-app-name-here
version: 1
runtime: python
api_version: 1
default_expiration: "30d"
handlers:
- url: /(.*\.(appcache|manifest))
mime_type: text/cache-manifest
@sohelrana820
sohelrana820 / app.yaml
Created August 1, 2017 13:35 — forked from darktable/app.yaml
GAE: App.yaml designed for serving a static site on Google App Engine (Python). Copy your static html and files into a folder called "static" next to app.yaml. Contains a bunch of mimetype declarations from html5boilerplate's .htaccess. May not be neces
application: you-app-name-here
version: 1
runtime: python
api_version: 1
default_expiration: "30d"
handlers:
- url: /(.*\.(appcache|manifest))
mime_type: text/cache-manifest
@sohelrana820
sohelrana820 / array-chunk-based-key.php
Last active September 17, 2018 14:57
Array Chunk based on Key PHP
<?php
/**
* @author: Sohel Rana <me.sohelrana@gmail.com>
* @author URL: http://sohelrana.me
* @licence: MIT
* @link: https://blog.sohelrana.me/array-chunk-based-on-key-value-in-php/
*
* This function is for divide/group/chunk an multidimensional array based on same key.
*/
@sohelrana820
sohelrana820 / recursively_delete_directory_and_its_files.php
Last active March 6, 2020 06:48
How to Recursively Delete a Directory and its Entire Contents Using PHP
<?php
/**
* @author: Sohel Rana <sohelrana820>
* @author URL: https://blog.sohelrana.me/
* @link: https://blog.sohelrana.me/recursively-delete-directory-entire-contents-using-php/
* @licence: MIT
*
* @param $directory
* @return bool
*/
@sohelrana820
sohelrana820 / app.js
Created June 19, 2017 18:03
Enable Sticky Header of Real Estate Template
$(function () {
'use strict';
// Showing page loader
$(window).load(function () {
setTimeout(function () {
$(".page_loader").fadeOut("fast");
}, 100)
});
/**
* @param int $length
* @return null|string
*/
public function generateDomainName($length = 7)
{
$randStr = null;
srand((double)microtime(TRUE) * 1000000);
$chars = array(
'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'p',