$ sudo apt-get update; sudo apt-get upgrade -y
$ sudo apt-get install -y git build-essential python-all-dev \
python-pip python-lxml python-magic python-imaging default-jre \
This file contains 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 validatePassword(password){ | |
var re = /^(?=.*[A-Z])[A-Za-z\d$@$!%*#?&^()-_+=`~|]{8,}$/; | |
if(re.test(password)){ | |
return true; | |
}else{ | |
return false; | |
} | |
}; |
This file contains 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 validateEmail(email){ | |
var re = /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/; | |
if(re.test(email)){ | |
return true; | |
}else{ | |
return false; | |
} | |
}; |
This file contains 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
stackoverflow.com/questions/19699257/uncaught-syntaxerror-unexpected-token-in-google-chrome | |
You are using a default parameter feature which is supported only by Firefox now. | |
function errorNotification(text) { | |
text = text || "Something went wrong!"; | |
$.pnotify({ | |
title: 'Error', | |
text: text, | |
type: 'error' |
This file contains 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
//default filter params | |
var filters = { | |
ftype: 'filters', | |
autoReload: false, | |
local : false, | |
encode: false, // json encode the filter query | |
}; | |
// docked elements |
This file contains 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
What Comes | |
------------------------------------------------- | |
id | type | pet_name | |
1 | aardvark | NULL | |
2 | dog | Charlie | |
3 | dog | Rover | |
4 | cat | Tabby | |
5 | cat | Sandy | |
6 | cat | MeowMeow |
This file contains 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
<script type="text/javascript"> | |
var BASE_URL = '<?php echo base_url(); ?>'; | |
var BASE_ICONS = BASE_URL+'assets/icons/'; | |
var grid_state_id = 'grid_<?php echo $section_id;?>'; | |
var grid_panel_id = 'tab-grid-<?php echo $section_id;?>'; | |
Ext.Loader.setConfig({enabled: true}); | |
Ext.Loader.setPath('Ext.ux', BASE_URL+'assets/js/ext/ux/'); |
This file contains 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 | |
$sql_query = array(); | |
foreach ($select_columns as $column) | |
{ | |
$sql_query [] = "( SELECT group_concat( DISTINCT $column ) FROM $master_grid_section_table WHERE 1 {$_search_filter_query} {$created_by} {$denied_data_entries} ) as $column"; | |
} | |
if( $result = $this->db->query("SELECT ". join(', ', $sql_query ))) | |
{ |
This file contains 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 | |
$actual_headers = array(); | |
foreach ($data['fields'] as $field) | |
{ | |
$actual_headers [] = $data['actual_headers'][$field]; | |
} | |
$path = realpath(BASEPATH."../assets/fmt/xls/"); | |
$fname = $title."-".time().".csv"; |
This file contains 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
LOAD DATA LOCAL INFILE 'G:/Floyd/small/small.csv' INTO TABLE `csv_data` | |
FIELDS TERMINATED BY ',' | |
OPTIONALLY ENCLOSED BY '"' | |
LINES TERMINATED BY '\r' | |
IGNORE 1 LINES; |