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 / depoyment.sh
Created October 13, 2015 06:31
Nodejs deployment
#!/bin/bash
while:
do
node server.js
echo "server crached!"
sleep 1
done
@eftakhairul
eftakhairul / nginx-html-app
Created November 14, 2015 07:18
Basic configuration for HTML App
server {
server_name abc.com;
listen 80;
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
root /home/app/html-app/dist;
index index.html index.htm;
@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;
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
@eftakhairul
eftakhairul / nginx_http_to_https
Last active November 30, 2016 16:32
Forcefully redirect from http to https
server {
listen 80 default_server;
listen [::]:80 default_server;
server_name example.com;
return 301 https://$server_name$request_uri;
}
@eftakhairul
eftakhairul / apache2_php
Last active November 30, 2016 16:37
Basic apache2 server configuration for php App
<VirtualHost *:80>
ServerAdmin mail@eftakhairul.com
DocumentRoot /home/app/php-app
ServerAlias www.abc.com
ServerName abc.com
<Directory /home/app/php-app>
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Order allow,deny
@eftakhairul
eftakhairul / nginx_redirection
Last active November 30, 2016 16:37
Basic redirection by nginx
server {
server_name abc.com;
return 301 http://xyz.com;
}
@eftakhairul
eftakhairul / ngix_html_angular_app
Last active November 30, 2016 16:37
ngix-html-angular-app
server {
server_name staging.io;
listen 80;
access_log /var/log/nginx/staging.io.access.log;
error_log /var/log/nginx/staging.io.error.log;
root /home/app/snap-ui/dist;
index index.html index.htm;