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
#!/bin/bash
# args
MSG=${1-'deploy from git'}
BRANCH=${2-'trunk'}
# paths
SRC_DIR=$(git rev-parse --show-toplevel)
DIR_NAME=$(basename $SRC_DIR)
DEST_DIR=~/svn/wp-plugins/$DIR_NAME/$BRANCH
<?php
namespace Application\Tools\Console\Commands;
use Symfony\Component\Console\Input\InputArgument,
Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Command\Command;
/**
@eftakhairul
eftakhairul / Simple Logger
Last active August 29, 2015 14:01
This is a simple logger written by me
function doLog($text, $path = null)
{
// open log file
$logFileName = empty($path)? "/system_log.text" : $path . "/system_log.text";
$logger = fopen($logFileName, "a") or die("Could not open log file.");
//Write the given test with time
fwrite($logger, date("d-m-Y, H:i")." - $text\n") or die("Could not write file!");
fclose($logger);
}
@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
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 / 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;
/
@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 / 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 / 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 / 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;