Skip to content

Instantly share code, notes, and snippets.

View shahariaazam's full-sized avatar
:octocat:
Open for opportunities

Shaharia Azam shahariaazam

:octocat:
Open for opportunities
View GitHub Profile
<?php
/**
* @param $url
* @param $apiKey
* @return mixed
*/
function isMobileReady($url, $apiKey)
{
$curl = curl_init();
curl_setopt_array($curl, array(
/**
* @author Shaharia Azam <shaharia.azam@gmail.com>
*/
angular.module('services', ['ngResource']).
factory("notesService", function ($resource) {
return $resource('/notes');
});
var app = angular.module('myApp', ['ngResource', 'services']);
<?php
$erp = new Erp();
$getPartnersInvoice = $erp->search('account.invoice', array(array('partner_id', '=', 57), array('state', '=', 'open')));
$getPartnersInvoiceDetails = $erp->read('account.invoice', array($getPartnersInvoice));
//var_dump($getPartnersInvoiceDetails); die();
$dataVoucher = array(
'journal_id' => (int)$getPartnersInvoiceDetails[0]['journal_id']['data']['value'][0]['int'],
location ~ \.php/?(.*)$ {
fastcgi_connect_timeout 3000s; # default of 60s is just too long
fastcgi_read_timeout 1000s; # default of 60s is just too long
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
############### Vartual Host PIGI ORDER PORTAL (Accounts) #######################
server {
listen 80;
server_name accounts.pop.dev;
root /var/www/pop/accounts/webroot/;
access_log /var/log/nginx/accounts-pop.access.log;
error_log /var/log/nginx/accounts-pop.error.log;
location / {
@shahariaazam
shahariaazam / bootstrap-ribbon.html
Created November 8, 2014 21:04
Bootstrap Ribbon CSS
<div class="panel panel-default">
<div class="panel-body">
<div class="panel-info">
<div class="folded">
<h2 style="background-color: #DB874A;">CakePHP</h2>
</div>
@shahariaazam
shahariaazam / ini-file-generator.php
Last active August 29, 2015 14:06
Write configuration data in a .ini file in PHP. It's important for large application to store global configurations about the whole/partial system for applications.
<?php
//@URL http://stackoverflow.com/questions/1268378/create-ini-file-write-values-in-php?answertab=votes#answer-1268642
function write_ini_file($assoc_arr, $path, $has_sections = FALSE)
{
$content = "";
if ($has_sections) {
foreach ($assoc_arr as $key => $elem) {
$content .= "[" . $key . "]\n";
foreach ($elem as $key2 => $elem2) {
@shahariaazam
shahariaazam / jquery-active-page-link-active.js
Created September 18, 2014 10:41
When you will click on a link from page navigation and when that page will be opened then that opened page related navigation li will be active
<?php
class MDC_IpManagerClass{
public $MyIp = $_SERVER['REMOTE_ADDR'];
//...................................................
// more code snippet
//...................................................
}
/**
* Here $MyIp is just a class property declaration. It can't holds any EXPRESSION.
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">02 RAMADAN - RAHMAT</h3>
</div>
<div class="panel-body">
<h1>29 June 2014</h1>
<h2>(SUNDAY)</h2>
<h3 class="sehri">Sehri: 03:42 AM</h3>
<h3 class="iftar">IFTAR: 06:49 PM</h3>
</div>