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

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 <biplob.ice@gmail.com>
*/
$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

@biplobice
biplobice / git-archive-patch.sh
Created March 31, 2022 02:58 — forked from josh-taylor/git-archive-patch.sh
Creates an archive of all files changed in a git repository since a given commit.
#!/bin/bash
# Explains how to use the script
usage()
{
cat << EOF
usage: $0 options
$0 -o output_file.zip commit_from [commit_to]
@biplobice
biplobice / BatchProcessingCommand.php
Last active December 8, 2021 02:21
Concrete CMS Batch Processing Command
<?php
/**
* @author: Biplob Hossain <biplob.ice@gmail.com>
* @license MIT
*/
namespace BatchProcessing\Console\Command;
use Concrete\Core\Console\Command;
use Concrete\Core\Support\Facade\Facade;