Skip to content

Instantly share code, notes, and snippets.

View biswarupadhikari's full-sized avatar

Biswarup Adhikari biswarupadhikari

View GitHub Profile
@biswarupadhikari
biswarupadhikari / default.php
Created January 29, 2013 13:36
How to Create Modal Window In Joomla
<?php JHTML::_('behavior.modal'); ?>
<a href="index.php?option=com_users&view=registration&tmpl=component" class="modal" rel="{handler: 'ajax',size: {x: 600, y: 450}}">Register Now For Deal</a>
@biswarupadhikari
biswarupadhikari / subdir.php
Created January 4, 2013 15:34
is_subdir php function. How to check is sub directory is php
<?php
function is_subdir($parent,$sub){
$parent=rtrim($parent,'/');
$sub=rtrim($sub,'/');
$parent=explode('/',$parent);
$sub=explode('/',$sub);
for($i=0;$i<count($parent);$i++){
if($parent[$i]!=$sub[$i]){
return false;
}
@biswarupadhikari
biswarupadhikari / joomlaPermission.sh
Created December 21, 2012 12:03
Ubuntu Joomla File Folder Recursive Permission Set
find /var/www/joomla -type f -exec chmod 0644 {} \;
find /var/www/joomla -type d -exec chmod 0755 {} \;
@biswarupadhikari
biswarupadhikari / test.sh
Created December 21, 2012 11:39
How to Install PHP Curl In Ubuntu
sudo apt-get install php5-curl
@biswarupadhikari
biswarupadhikari / copy.sql
Created December 18, 2012 13:13
All All Mysql Data From One Table to Another
INSERT INTO mydb.test2 SELECT * FROM mydb.test
The above query will copy all data from test table to test2 table.
@biswarupadhikari
biswarupadhikari / test.sql
Created December 18, 2012 13:10
Clone Mysql Table Struture
create table mydb.test2 like mydb.test;
@biswarupadhikari
biswarupadhikari / trim.js
Created December 13, 2012 13:57
JavaScript Trim Functionality
if(typeof String.prototype.trim !== 'function') {
String.prototype.trim = function() {
return this.replace(/^\s+|\s+$/g, '');
}
}
@biswarupadhikari
biswarupadhikari / gist:4213130
Created December 5, 2012 06:47
LAMP /var/www/ Permission Setup Ubuntu Localhost
let say your username is adidac
$ sudo add user adidac www-data
$ sudo chown -R www-data:www-data /var/www/
$ sudo chmod -R g+rw /var/www/
@biswarupadhikari
biswarupadhikari / gist:4055958
Created November 11, 2012 19:22
Joomla : Get Module Parameter from Joomla 1.6,1.7,2.5
jimport( 'joomla.application.module.helper' );
$module = JModuleHelper::getModule('mod_jogajog');
$params = new JRegistry;
$params->loadString($module->params, 'JSON');
echo '<pre>';
print_r($params);
echo '</pre>';
@biswarupadhikari
biswarupadhikari / gist:4038614
Created November 8, 2012 12:50
How to Detect Right Click Linux Java JTable
jt.addMouseListener(new MouseAdapter() {
public void mouseReleased(MouseEvent e) {
int r = jt.rowAtPoint(e.getPoint());
if (r >= 0 && r < jt.getRowCount()) {
jt.setRowSelectionInterval(r, r);
} else {
jt.clearSelection();
}
int rowindex = jt.getSelectedRow();