Skip to content

Instantly share code, notes, and snippets.

View jubayerarefin's full-sized avatar
🏠
Working from home

Sharif Jubayer Arefin jubayerarefin

🏠
Working from home
View GitHub Profile
@jubayerarefin
jubayerarefin / ApnsPushService.php
Created September 1, 2023 06:11 — forked from efreed/ApnsPushService.php
PHP NotificationPusher to mobile devices (namespace is ready to work with Symfony)
<?php
namespace App\Service\Notification\PushNotification;
use Exception;
// composer require edamov/pushok
// https://github.com/edamov/pushok
use Pushok\AuthProvider;
use Pushok\Client;
use Pushok\Notification;
@jubayerarefin
jubayerarefin / introrx.md
Created June 25, 2020 06:53 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
@jubayerarefin
jubayerarefin / Windows Defender Exclusions VS 2017.ps1
Created April 16, 2020 02:13
Adds Windows Defender exclusions for Visual Studio 2019
$userPath = $env:USERPROFILE
$pathExclusions = New-Object System.Collections.ArrayList
$processExclusions = New-Object System.Collections.ArrayList
$pathExclusions.Add('C:\Windows\Microsoft.NET') > $null
$pathExclusions.Add('C:\Windows\assembly') > $null
$pathExclusions.Add($userPath + '\AppData\Local\Microsoft\VisualStudio') > $null
$pathExclusions.Add('C:\ProgramData\Microsoft\VisualStudio\Packages') > $null
$pathExclusions.Add('C:\Program Files (x86)\MSBuild') > $null
$pathExclusions.Add('C:\Program Files (x86)\Microsoft Visual Studio') > $null
@jubayerarefin
jubayerarefin / clean-up-boot-partition-ubuntu.md
Created May 15, 2018 09:50 — forked from ipbastola/clean-up-boot-partition-ubuntu.md
Safest way to clean up boot partition - Ubuntu 14.04LTS-x64

Safest way to clean up boot partition - Ubuntu 14.04LTS-x64

Reference

Case I: if /boot is not 100% full and apt is working

1. Check the current kernel version

$ uname -r 
@jubayerarefin
jubayerarefin / Elastic.php
Created December 1, 2016 07:18 — forked from michaelstivala/Elastic.php
Wrapper for Elasticsearch Client
<?php
namespace App\Elastic;
use Elasticsearch\Client;
class Elastic
{
protected $client;
@jubayerarefin
jubayerarefin / gist:4e403bb0db980f4990f01f2f3de39978
Created November 27, 2016 10:26 — forked from lukas-vlcek/gist:1075067
Test of attachments plugin
#!/bin/sh
host=localhost:9200
curl -X DELETE "${host}/test"
curl -X PUT "${host}/test" -d '{
"settings" : { "index" : { "number_of_shards" : 1, "number_of_replicas" : 0 }}
}'
@jubayerarefin
jubayerarefin / gist:02c0f4ce24835e75f0eea480e8ce2ef4
Created November 27, 2016 04:15
Test of attachments plugin
#!/bin/sh
host=localhost:9200
curl -X DELETE "${host}/test"
curl -X PUT "${host}/test" -d '{
"settings" : { "index" : { "number_of_shards" : 1, "number_of_replicas" : 0 }}
}'
@jubayerarefin
jubayerarefin / laravel_nginx.md
Created September 21, 2016 07:10 — forked from folivares/laravel_nginx.md
Nginx configuration for Laravel 5.1

Nginx Server Blocks configuration to run more than one Laravel 5.1 web-app off of a single Linux server

Prerequisites

  • PHP package: php5-fpm php5-mcrypt php5-mysql
  • Laravel 5.1
  • Nginx 1.8

Default Server Block

@jubayerarefin
jubayerarefin / objects_arrays.md
Created September 18, 2016 11:57 — forked from nikic/objects_arrays.md
Post explaining why objects often use less memory than arrays (in PHP)

Why objects (usually) use less memory than arrays in PHP

This is just a small post in response to [this tweet][tweet] by Julien Pauli (who by the way is the release manager for PHP 5.5). In the tweet he claims that objects use more memory than arrays in PHP. Even though it can be like that, it's not true in most cases. (Note: This only applies to PHP 5.4 or newer.)

The reason why it's easy to assume that objects are larger than arrays is because objects can be seen as an array of properties and a bit of additional information (like the class it belongs to). And as array + additional info > array it obviously follows that objects are larger. The thing is that in most cases PHP can optimize the array part of it away. So how does that work?

The key here is that objects usually have a predefined set of keys, whereas arrays don't:

Multiple PHP version under Ubuntu 14.04

Update your machine

apt-get update
apt-get upgrade

Install some dependencies

apt-get install build-essential