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
$(document).ready(function(){ | |
jQuery.validator.addMethod("phoneUS", function(phone_number, element) { | |
phone_number = phone_number.replace(/\s+/g, ""); | |
/*return this.optional(element) || phone_number.length > 9 && | |
phone_number.match(/^\(\d{3}\) ?\d{3}( |-)?\d{4}|^\d{3}( |-)?\d{3}( |-)?\d{4}/);*/ | |
return this.optional(element) || phone_number.length > 9 && | |
phone_number.match(/^(\d{3})(-\d{3})(-\d{4})$/); | |
}, "Please specify a valid phone number<br>Example: 204-303-3403"); |
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
$(document).ready(function(){ | |
jQuery.validator.addMethod("phoneUS", function(phone_number, element) { | |
phone_number = phone_number.replace(/\s+/g, ""); | |
/*return this.optional(element) || phone_number.length > 9 && | |
phone_number.match(/^\(\d{3}\) ?\d{3}( |-)?\d{4}|^\d{3}( |-)?\d{3}( |-)?\d{4}/);*/ | |
return this.optional(element) || phone_number.length > 9 && | |
phone_number.match(/^(\d{3})(-\d{3})(-\d{4})$/); | |
}, "Please specify a valid phone number<br>Example: 204-303-3403"); |
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
<script> | |
$(document).ready(function(){ | |
$(document).on('click','.tour-modal-next', function(e){ | |
e.preventDefault(); | |
var tour_id= parseInt($(this).attr('id')); | |
tour_id++; | |
$('.tour-modal').hide(); | |
if(tour_id != 5) { | |
$('#take-the-tour-'+tour_id).show(); |
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
Saving time data into DB | |
$this->load->model('time_model'); | |
$user_id = $this->session->userdata('id'); | |
$user_timezone = $this->time_model->getTimeZone($user_id); | |
$format = "U"; // automatically saves it in unix format, this is just to show you that you can adjust format.... | |
$data['timestamp'] = $this->time_model->getUTCTimeStamp($user_timezone, $format); | |
Shorthand: $data['timestamp'] = $this->time_model->getUTCTimeStamp($this->time_model->getTimeZone($this->session->userdata('id')); |
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
<!--for HTML5 / modern browsers--> | |
<input name="name" placeholder="Enter Name" value="" /> | |
<!--for newer browsers--> | |
<input name="name" value="Enter Name" onfocus="if(this.value=='Enter Name')this.value='';" onblur="if(this.value=='')this.value='Enter 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
var BrowserDetect = { | |
init: function () { | |
this.browser = this.searchString(this.dataBrowser) || "An unknown browser"; | |
this.version = this.searchVersion(navigator.userAgent) | |
|| this.searchVersion(navigator.appVersion) | |
|| "an unknown version"; | |
this.OS = this.searchString(this.dataOS) || "an unknown OS"; | |
}, | |
searchString: function (data) { | |
for (var i=0;i<data.length;i++) { |
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
//of your theme... | |
function test_ajax() | |
{ | |
$pass = "empty"; | |
if( isset( $_POST['passthrough'] ) ){ $pass = $_POST['passthrough']; } | |
die( json_encode( array("result"=>"true", "vars" => $pass) ) ); | |
} | |
add_action( 'wp_ajax_nopriv_test_ajax', 'test_ajax' ); // if user is not logged in |
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
$('html').click(function(){ | |
// Hide Menus if visible | |
$('#yourMenuName').hide(); | |
}); | |
$('html').on('submit', '#form2', function(e){ | |
e.preventDefault(); | |
$('#yourOverlayName').show(); | |
}); |
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
Step 1 - Sharing/Share Folder | |
https://api.dropboxapi.com/2/sharing/share_folder | |
{ | |
"path": {your path}, | |
"force_async": false, | |
"acl_update_policy": "editors" | |
} | |
it returns the shared folder id in the root as shared_folder_id |
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
Problem: Need to search files in subdirectory for metadata | |
Solution: | |
1) Find files and matches and output to data file | |
a) Use find to get loop of files.. | |
b) identify -verbose to get metadata of files.. | |
c) grep to get lines around match.. | |
d) cat to output it to results file | |
2) Make sense of response data |
OlderNewer