Skip to content

Instantly share code, notes, and snippets.

View HOA
<?php
/**
* Single Listing CT IDX Pro Info
*
* @package WP Pro Real Estate 7
* @subpackage Include
*/
global $ct_options;
View idx_get_grouped_features
<?php
// Usage:
$post_id = 'POST_ID_HERE';
echo idx_get_grouped_features( $post_id );
/**
Example Output:
<div class="idx_grouped_features">
<h4>Interior</h4>
<ul>
@m4munib
m4munib / bytes-to-image-aspnet.cs
Created Aug 16, 2016
How to render bytes Image on the fly
View bytes-to-image-aspnet.cs
try {
byte[] imageBytes = null;
imageBytes = ...; //read image from the disk
if (imageBytes != null)
{
Response.Clear();
Response.ContentType = "image/jpg";
Response.BinaryWrite(imageBytes);
@m4munib
m4munib / envato-api-nodejs-http-request-helper.js
Created May 30, 2016
Envato API - HTTP Request - Node.js
View envato-api-nodejs-http-request-helper.js
var httpHelper = require('./helper/http');
var options = {
host: 'marketplace.envato.com',
path: '/api/edge/number-of-files:themeforest.json',
method: "GET",
headers: {'user-agent': 'Node.js - Envato API Consumer'}
};
httpHelper.request(options, function (body) {
View get-nodejs-http-request-helper.js
/*GET Request*/
var httpHelper = require('./helper/http');
var options = {
host: 'www.domain.com',
path: '/example-page',
method: 'GET'
};
httpHelper.request(options, function (body) {
@m4munib
m4munib / nodejs-http-request-helper.js
Created May 30, 2016
HTTP request helper using Node.js
View nodejs-http-request-helper.js
var http = require('http');
function request(options, callback)
{
http.request(options, function (response) {
var responseBody = '';
response.on('data', function (data) {
responseBody += data;
});
@m4munib
m4munib / user_signup_command.php
Created May 29, 2016
User Signup using PHP Command Pattern
View user_signup_command.php
<?php
class SignupCommand extends AbstractCommand {
private $oUser = null;
private $data = array();
function __construct($oUser, $data) {
$this->oUser = $oUser;
$this->data = $data;
@m4munib
m4munib / php_command_pattern.php
Created May 29, 2016
Abstract Class - PHP Command
View php_command_pattern.php
<?php
interface InterfaceCommand {
function execute();
}
abstract class AbstractCommand implements InterfaceCommand {
/**