Skip to content

Instantly share code, notes, and snippets.

View nadalizadeh's full-sized avatar

Ali N. nadalizadeh

View GitHub Profile
@nadalizadeh
nadalizadeh / sample.read.js
Last active October 20, 2020 12:20
Read and Write Thrift Encoded Buffers in node.js
var thrift = require('thrift')
var ttypes = require('./gen-nodejs/serialization_types') // Replace it with your own ttypes generated file
// Use frame transport to read
var Transport = thrift.TFramedTransport
var Protocol = thrift.TCompactProtocol
// packet.payload is the thrift encoded data we have received
var bufTrans = new Transport(packet.payload)
var myprot = new Protocol(bufTrans)
@nadalizadeh
nadalizadeh / CustomSelectDecorator.php
Last active May 16, 2021 04:50
SELECT....FOR UPDATE hack in Zend Framework 2 (ZF2)
<?php
/* Adjust namespace with your own code */
namespace Data;
use Zend\Db\Adapter\Driver\DriverInterface;
use Zend\Db\Adapter\ParameterContainer;
use Zend\Db\Adapter\Platform\PlatformInterface;
use Zend\Db\Sql\Platform\Mysql\SelectDecorator;
class CustomSelectDecorator extends SelectDecorator {
@nadalizadeh
nadalizadeh / 0-ip-based-attribution-how-to.jpg
Last active August 3, 2019 15:21
IP-Based Tracking and Ad Network Callbacks
0-ip-based-attribution-how-to.jpg