Skip to content

Instantly share code, notes, and snippets.

View biplobice's full-sized avatar
🖥️
while (success!==true) { keepMovingForward(); }

Md Biplob Hossain biplobice

🖥️
while (success!==true) { keepMovingForward(); }
View GitHub Profile
@biplobice
biplobice / db_row_counts.php
Created August 27, 2025 12:11
A simple PHP script to count the number of rows in all tables of a Concrete CMS database
<?php
/**
* @author: Biplob Hossain <biplob.me>
*/
defined('C5_EXECUTE') or die("Access Denied");
use Concrete\Core\Database\Connection\Connection;
use Concrete\Core\Support\Facade\Facade;
$app = Facade::getFacadeApplication();
@biplobice
biplobice / gist:0b0fd82344dd5ed1fe4a7183bc01749e
Created August 18, 2025 02:49
Customize ckEditor config options
<?php
// application/config/site.php
return [
'sites' => [
'default' => [
'editor' => [
'ckeditor4' => [
'custom_config_options' => [
'entities' => false, // Disables conversion of characters to HTML entities entirely. Example: Stops converting © into &copy;, or & into &amp;.
'basicEntities' => false, // Prevents encoding of “basic” characters like &, <, >, ", '.

EC SAML Troubleshooting

How the SAML Login Process Works (Advancing to the Next Step When the User Is Not Found):

  1. Initially, it seeks a user mapping in the EcSamlIdentityProviderUser table using the SAML Unique ID.
  2. If username linking is enabled, it searches for a user associated with the SAML username attribute.
  3. If email linking is enabled, it attempts to locate a user based on the SAML email attribute.
  4. If no match is found, it proceeds to create a new user entry in the Users table and establishes a mapping in the EcSamlIdentityProviderUser table.
@biplobice
biplobice / clean-expired-cookies.php
Last active October 5, 2022 11:05
A simple PHP script to delete expired auth type concrete cookies
<?php
use Carbon\Carbon;
defined('C5_EXECUTE') or die('Access Denied.');
/**
* @author: Biplob Hossain <[email protected]>
*/
$db = app('database/connection');
@biplobice
biplobice / rest-api-response-format.md
Created September 9, 2022 04:54 — forked from igorjs/rest-api-response-format.md
REST API response format based on some of the best practices
@biplobice
biplobice / User.php
Created August 22, 2022 06:34 — forked from Ocramius/User.php
Doctrine 2 ManyToMany - the correct way
<?php
use Doctrine\ORM\Mapping as ORM;
use Doctrine\Common\Collections\ArrayCollection;
/**
* @ORM\Entity()
* @ORM\Table(name="user")
*/
class User
@biplobice
biplobice / stripe_currencies.php
Created June 16, 2022 03:52
Stripe Currencies
<?php
return [
'AFN' => 'Afghan Afghani',
'ALL' => 'Albanian Lek',
'DZD' => 'Algerian Dinar',
'AOA' => 'Angolan Kwanza',
'ARS' => 'Argentine Peso',
'AMD' => 'Armenian Dram',
'AWG' => 'Aruban Florin',
@biplobice
biplobice / ssh-tutorial.md
Created May 20, 2022 06:58 — forked from slowkow/ssh-tutorial.md
ssh to a server without typing your password

How to ssh to a remote server without typing your password

Save yourself a few keystrokes. Follow the steps below:

  1. Run this Bash script on your laptop:

    #!/usr/bin/env bash
    

The hostname of your remote server.

@biplobice
biplobice / CrossCompatibleTabbedNavHack.php
Last active April 22, 2022 08:58
A simple hack to support tabbed navigation both on Concrete CMS v8.X & v9.X
<?php
// v8 compatibility
if (Config::get('concrete.version_installed') < 9) {
?>
<script>
$('.tab-pane').each(function () {
$(this).removeClass('active').attr('id', 'ccm-tab-content-' + $(this).attr('id'));
if ($(this).hasClass('show')) {
$(this).removeClass('show').show();
}
@biplobice
biplobice / git-zip-changed-files.md
Created March 31, 2022 03:33 — forked from ciases/git-zip-changed-files.md
Git: zip changed files + diff

GIT: zip changed files + diff

Create zip archive with changed files

git archive -o update.zip HEAD $(git diff --name-only <starting SHA> HEAD)

or