Skip to content

Instantly share code, notes, and snippets.

View iZaL's full-sized avatar

Afzal Abbas iZaL

View GitHub Profile
@iZaL
iZaL / NewMessage.php
Created January 17, 2018 13:16 — forked from sebastiaanluca/NewMessage.php
Laravel + Redis + NodeJS + Socket.io pub/sub secure server and client supporting multiple rooms, channels, users, … Add `client.js` to your client app, run `node server.js`, and trigger the Laravel event any way you want to broadcast the data.
<?php
namespace App\Events;
use Illuminate\Contracts\Broadcasting\ShouldBroadcast;
use Illuminate\Queue\SerializesModels;
class NewMessage extends Event implements ShouldBroadcast
{
openssl pkcs12 -in Certificates_Prod.p12 -out pushcert_prod.pem -nodes -clcerts
<?php
public function test()
{
$kuwaitCityLocations = [
'Abdullah al-Salem',
'Adailiya',
'Bneid Al Qar',
'Daiya',
'Dasma',
'Dasman',
@iZaL
iZaL / knet.php
Last active November 28, 2023 11:07
<?php
/**
* Checkout method
*/
public function knetCheckout($orderID)
{
$order = $this->orderModel->find($orderID);
$invoiceID = $this->generateInvoiceCode();
@iZaL
iZaL / countries.sql
Created August 27, 2019 09:51 — forked from adhipg/countries.sql
Sql dump of all the Countries, Country Codes, Phone codes.
CREATE TABLE IF NOT EXISTS `country` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`iso` char(2) NOT NULL,
`name` varchar(80) NOT NULL,
`nicename` varchar(80) NOT NULL,
`iso3` char(3) DEFAULT NULL,
`numcode` smallint(6) DEFAULT NULL,
`phonecode` int(5) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
@iZaL
iZaL / Laravel-Container.md
Created October 25, 2019 19:00
Laravel's Dependency Injection Container in Depth

Laravel's Dependency Injection Container in Depth

Translations: Korean (by Yongwoo Lee)

Laravel has a powerful Inversion of Control (IoC) / Dependency Injection (DI) Container. Unfortunately the official documentation doesn't cover all of the available functionality, so I decided to experiment with it and document it for myself. The following is based on Laravel 5.4.26 - other versions may vary.

Introduction to Dependency Injection

I won't attempt to explain the principles behind DI / IoC here - if you're not familiar with them you might want to read What is Dependency Injection? by Fabien Potencier (creator of the Symfony framework).

Improving heat management after macbookpro 2011 discrete GPU fix, also a script to automate part of the fix process

Taken from StackExchange

Thanks to LangLangC

NOTE: This is experimental; works for some people, not for others

Improved thermal and power management