Skip to content

Instantly share code, notes, and snippets.

View md-riaz's full-sized avatar
👨‍💻
PHP Developer

MD Riaz md-riaz

👨‍💻
PHP Developer
View GitHub Profile
@md-riaz
md-riaz / ckeditor-responsive-images.js
Created June 6, 2023 11:04 — forked from fabiomaggio/ckeditor-responsive-images.js
Make inserted images in CKEditor automatically responsive
// If you want inserted images in a CKEditor to be responsive
// you can use the following code. It creates a htmlfilter for the
// image tag that replaces inline "width" and "style" definitions with
// their corresponding attributes and add's (in this example) the
// Bootstrap "img-responsive" class.
CKEDITOR.on('instanceReady', function (ev) {
ev.editor.dataProcessor.htmlFilter.addRules( {
elements : {
img: function( el ) {
// Add bootstrap "img-responsive" class to each inserted image
<?php
function convertCronJobScheduleToHumanReadable($schedule) {
// Split the schedule into its components.
$components = explode(' ', $schedule);
// Get the minute, hour, day of month, month, day of week, and year components.
$minute = $components[1] ?? '*';
$hour = $components[2] ?? '*';
$dayOfMonth = $components[3] ?? '*';
<?php
// Set the client ID and secret
$client_id = "YOUR_CLIENT_ID";
$client_secret = "YOUR_CLIENT_SECRET";
// Set the scope for email and drive
$scope =
"https://www.googleapis.com/auth/userinfo.email https://www.googleapis.com/auth/drive";
<?php
error_reporting(E_ALL & ~E_NOTICE);
class cPanelLicensing {
function __construct ($user, $pass, $key = NULL) {
if (!function_exists('curl_init')) {
die("cPanelLicensing requires that curl+ssl support is compiled into the PHP interpreter\n");
}
$this->set_format("simplexml");
$this->curl = curl_init();
<?php
use Psr\Log\LoggerInterface;
interface ClientInterface
{
/**
* Constructor
<?php
use phpseclib\Net\SSH2;
class ZimbraAccountManager {
private $sshHost = "zimbra.example.com";
private $sshUser = "root";
private $sshPassword = "rootpassword";
public function createAccount($email, $password) {
$command = "zmprov ca $email $password";
<?php
class SocialLogin
{
private $provider;
private $client_id;
private $client_secret;
private $redirect_uri;
private $access_token;
class ImageMerger {
private $og_image;
private $site_banner;
private $output_name;
private $output_path;
public function __construct($og_image, $site_banner, $output_name, $output_path) {
$this->og_image = $og_image;
$this->site_banner = $site_banner;
$this->output_name = $output_name;
import 'package:flutter/material.dart';
class AdvancedTextFormField extends StatelessWidget {
final String labelText;
final String hintText;
final String initialValue;
final bool obscureText;
final TextInputType keyboardType;
final TextCapitalization textCapitalization;
final List<TextInputFormatter> inputFormatters;
@md-riaz
md-riaz / main.dart
Last active January 19, 2023 03:02
simple-travel-info
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
theme: ThemeData(