This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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; | |
/** |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
VAGRANTFILE_API_VERSION = "2" | |
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| | |
config.vm.box = "hashicorp/precise64" | |
config.vm.network "private_network", ip: "192.168.0.210" | |
config.vm.synced_folder "./dev", "/var/www", create: true | |
config.vm.provision "shell", path: "https://gist.githubusercontent.com/EmranAhmed/10682844/raw/13d127a5982fa47331aa019ac2d27b9c08f86229/vagrant-provision.sh" | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<VirtualHost *:80> | |
ServerAdmin [email protected] | |
DocumentRoot /home/eftakhairul/codes/php/projects/kondar-global/ | |
ServerName www.kgt-global.local | |
ErrorLog ${APACHE_LOG_DIR}/error.log | |
CustomLog ${APACHE_LOG_DIR}/access.log combined | |
<Directory /home/eftakhairul/codes/php/projects/kondar-global/> | |
Require all granted | |
Options Indexes FollowSymLinks MultiViews | |
AllowOverride All |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class RemoveOldDuplicatePhoneNumberReference < ActiveRecord::Migration | |
def change | |
#fetch all user and remove the cross reference for duplicate phone number | |
User.real_users.find_in_batches.each(:batch_size => 100) do |batch| | |
batch.each do |u| | |
if u.annotations[:users_with_the_same_phone] | |
# remove other users' reference who are associated with this user |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
##------------------------------------ ## | |
# -- new-alias -- # | |
# creates new alias & writes to file # | |
# $1 = alias new # | |
# $2 = alias definition # | |
##------------------------------------ ## | |
new-alias () { | |
if [ -z "$1" ]; then | |
echo "alias name:" | |
read NAME |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php if (!defined('BASEPATH')) exit('No direct script access allowed'); | |
/** | |
* Description of ISBA Library | |
* | |
* @package Library | |
* @author Jamael Tanveer Nayon <[email protected]> | |
* @author Eftakhairul Islam <[email protected]> http://eftakhairul.com | |
* @website Changebd.net | |
*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
while: | |
do | |
node server.js | |
echo "server crached!" | |
sleep 1 | |
done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
upstream app { | |
# Path to Puma SOCK file, as defined previously | |
server unix:/home/app/abc-app/shared/sockets/puma.sock fail_timeout=0; | |
} | |
server { | |
listen 80; | |
server_name localhost; | |
root /home/app/abc-app/public; |