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 / gist:bd11c0fa5cb5ca08c043c8a42faa7f72
Created May 31, 2021 05:36 — forked from samarpanda/gist:4125105
Test your php code execution time and Memory usage
<?php
// from http://php.net/manual/en/function.filesize.php
function formatBytes($bytes, $precision = 2) {
$units = array('B', 'KB', 'MB', 'GB', 'TB');
$bytes = max($bytes, 0);
$pow = floor(($bytes ? log($bytes) : 0) / log(1024));
$pow = min($pow, count($units) - 1);
@biplobice
biplobice / c5-ses.md
Created October 28, 2020 04:00
Send Email Using Amazon SES with concrete5

Send Email Using Amazon SES with concrete5

In this tutorial, you will learn how to send email using Amazon SES with concrete5. We will walk through how to verify that you own the domain or email address, and then send an email using the Amazon SES console.

What is Amazon SES

Amazon Simple Email Service (SES) is a cost-effective email service built on the reliable and scalable infrastructure that Amazon.com developed to serve its own customer base. With Amazon SES, you can send transactional email, marketing messages, or any other type of high-quality content to your customers.

Step 1: Enter the Amazon SES Console

Develop concrete5 site with valet and make a cli alias to save development time

[This article is for beginners only.]

Now a days laravel valet is so popular to web developers for it's simplicity and easy to use. If you don't know about valet please take a look on valet documentation.

Now valet has environment support for concrete5. You just need to add config files with prefix valet. For example- you work in a team and your project hasa database configuration file in application/config/database.php. But different users has different database name, username, password in your team. So, you can make a file in application/config/valet.database.php and add this path on .gitignore file. Concrete5 is that smart to get this value automatically.

For faster development, you may have to use concrete5 command line interface frequently. If you don't know about concrete5 command line tool please take a look concrete5 command line interface [documentation](https://do

@biplobice
biplobice / curl.md
Created October 19, 2020 08:41 — forked from subfuzion/curl.md
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

<?php
namespace Application\Concrete\Console\Command;
use Concrete\Core\Console\Command;
use Concrete\Core\Error\UserMessageException;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
class MyCommand extends Command
@biplobice
biplobice / Elemental Theme Blocks.md
Last active May 19, 2020 06:40
Area names of the concrete5 Elemental theme

Elemental Theme Blocks

  • Elements/Header
    • Header Site Title
    • Header Navigation
  • Default
    • Main
    • Page Footer
  • Left Sidebar
    • Page Header
  • Sidebar
@biplobice
biplobice / app.php
Created May 13, 2020 06:08 — forked from katzueno/app.php
concrete5 Environment switch according to host name
<?php
// /application/bootstrap/app.php
Route::register('/ccm/request_test', function() {
header("Pragma: no-cache");
echo '<dl>';
?><dt>Application environment:</dt><dd><?php echo ($this->app->environment()) ? $this->app->environment() : 'default'; ?></dd><?php
$request = \Concrete\Core\Http\Request::getInstance();
?><dt>Client IP:</dt><dd><?php echo $request->getClientIp(); ?></dd><?php
?><dt>Host:</dt><dd><?php echo $request->getHost(); ?></dd><?php
?><dt>Port:</dt><dd><?php echo $request->getPort(); ?></dd><?php

Problem: Dyld: Library not loaded: /usr/local/opt/icu4c/lib/libicui18n.63.dylib error message

Workaround:

brew uninstall --ignore-dependencies --force node
brew uninstall --ignore-dependencies --force icu4c
brew install icu4c
brew unlink icu4c && brew link icu4c --force
brew install node

Customizing System Preferences

Trackpad Options

  • Go To System Preferences > Trackpad.
  • Enable all options across all tabs.
  • Back & go to System Preferences > Accessibility > Mouse & Trackpad > Trackpad Options.
  • Enable dragging with three finger drag.

Date & Time Options

@biplobice
biplobice / README.md
Created October 15, 2019 01:49
How to add swap file
sudo swapon -s
free -m
df -h
sudo fallocate -l 4G /swapfile
ls -lh /swapfile
sudo chmod 600 /swapfile
ls -lh /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile