Skip to content

Instantly share code, notes, and snippets.

View eftakhairul's full-sized avatar
💭
writing code for spaceship :P

Md Eftakhairul Islam eftakhairul

💭
writing code for spaceship :P
View GitHub Profile
@eftakhairul
eftakhairul / Introduction to Ruby
Last active October 2, 2019 18:06
Some snippets of Ruby on Knowledge Sharing Session -Ruby at Mangoes Mobile
=begin
author Eftakhairul Islam <eftakhairul@gmail.com>
website http://eftakhairul.com
=end
#My First Program at Ruby.
puts 'Hello World'
puts ("I'm here")
@eftakhairul
eftakhairul / Chnage App Crime Map Script
Created July 1, 2012 12:17
Raw Javascript of Crime Map at Change App
var map;
var saveLat = 0;
var saveLng = 0;
var lat = 23.71003142406148;
var lon = 90.407231156616290;
var image = "<?php echo site_url('assets/images/pirates.png')?>";
if (!navigator.geolocation) {
alert('Get a better browser');
}
@eftakhairul
eftakhairul / JsonToObjectConvert
Created September 3, 2012 20:49
Json to function call
<?php
$json = 'YOUR JOSN HERE';
$patterns = json_decode($json);
$patternObjects = array();
foreach ($patterns->patterns as $pattern) {
$patternObj = new Pattern();
$patternObjects[] = mapJsonToObject($patternObj, $pattern);
}
@eftakhairul
eftakhairul / Nginx Default Configuration
Created September 11, 2012 19:12
Nginx Default Configuration in located /etc/nginx/conf.d/default.conf
#
# The default server
#
server {
listen 80;
server_name _;
#charset koi8-r;
#access_log logs/host.access.log main;
@eftakhairul
eftakhairul / Nginx Virtual Host Configuration
Created September 11, 2012 19:15
Nginx Virtual Host Configuration for www.example.com
server {
listen 80;
server_name www.example.com example.com;
#access_log /usr/share/nginx/html/example/logs/access.log;
#error_log /usr/share/nginx/html/example/logs/error.log;
location / {
root /usr/share/nginx/html/example;
index index.html index.htm index.php;
@eftakhairul
eftakhairul / debug.php
Last active December 15, 2015 04:39
Easy Debug
class Debug
{
private $debug = true;
private $start_time = 0;
/**
* prints debug message
* @param type $message
*/
@eftakhairul
eftakhairul / ExtractvalueFunction.php
Last active December 15, 2015 16:49
Oracle 11g Extractvalue DQL function for Doctrine
/**
* This is the custom extractvalue function for doctrine.
*
* www.eftakhairul.com
*/
use Doctrine\ORM\Query\Lexer;
use Doctrine\ORM\Query\AST\Functions\FunctionNode;
@eftakhairul
eftakhairul / gist:5318723
Created April 5, 2013 11:52
it's a Oracle Stored Procedure which actually select multiple rows and inserts those with some new parameters...
SAVEPOINT INSERT_DOCUMENT_DATE;
BEGIN
FOR i in (SELECT document_id
FROM document_date
WHERE type_id = 5 AND document_id not in (SELECT document_id FROM document_date where type_id = 6) AND day < TO_DATE(CURRENT_DATE, 'DD-MON-RR')) LOOP
INSERT INTO document_date(ID,DOCUMENT_ID,type_id,day) VALUES(DOCUMENT_DATE_ID_SEQ.nextval, i.document_id, 6, TO_DATE(CURRENT_DATE, 'DD-MON-RR'));
END LOOP;
END;
/
INSERT INTO SENDABLE_DOCUMENT (DOCUMENT_ID)
SELECT p1.ID FROM (
SELECT p2.document_id AS ID, ROWNUM AS ID_ROWNUM FROM (
SELECT document_id FROM document_date
INNER JOIN SYNDICATED_DOCUMENT sd ON document_date.document_id = sd.ID
WHERE type_id = :published and document_id not in (SELECT document_id FROM document_date where type_id = :sent)
) p2 WHERE ROWNUM <= :maxRow
) p1 WHERE ID_ROWNUM >= :minRow
@eftakhairul
eftakhairul / Java Tutorial Text
Last active December 29, 2015 01:29
Learning Java and some tips
#Static initialization
All static initialization get call first before main method and contractor.
#constructor
If a sub class extends from parents class, then if you create the instance of Subclass, automatically parents constructor will get called.
#Protected Modifier
he protected modifier specifies that the member can only be accessed within its own package (as with package-private) and, in addition, by a subclass of its class in another package.
#final