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 / 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 <[email protected]>
* @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',
@sohelrana820
sohelrana820 / task-manager-issue-fixing.js
Last active June 3, 2017 22:22
URL decoder (decodeURIComponent) issue fixed of task manger application.
// Open PROJECT_ROOT/plugins/Apps/webroot/js/src/ProjectsCtrl.js and go to line no 6.
projectSlug = decodeURIComponent(projectSlug);
// Add this line after line 6
// Open PROJECT_ROOT/plugins/Apps/webroot/js/src/FeedsCtrl.js and go to line no 11.
$scope.projectSlug = decodeURIComponent($scope.projectSlug);
// Add this line after line 11
// Open PROJECT_ROOT/plugins/Apps/webroot/js/src/LabelsCtrl.js and go to line no 10.
projectSlug = decodeURIComponent(projectSlug);
<?php
// Open PROJECT_ROOT/src/Controller/AppController.php file and go to line no 123 (approximate line or find $this->Auth->allow)
// And then replace this snippet with below snippet.
$this->Auth->allow([
'signup',
'verifyEmail',
'forgotPassword',
'install',
'resetPassword',
'requirements',