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 | |
$results = ClinicalStudy::where( function( $query ) use ( $data ) | |
{ | |
$query->where('brief_title', 'like', $data['query'] .'%') | |
->orWhere('source', 'like', $data['query'] .'%') | |
->orWhere('brief_summary', 'like', $data['query'] .'%') | |
->orWhere('detailed_description', 'like', $data['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
// where this.conditionsLetters is | |
// ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"] | |
if ( this.conditionsLetters.indexOf( $letter ) > -1 ) { // check if match found | |
this.selectedConditionsLetter = $letter; | |
} | |
// no match returns -1, | |
// whereas a match returns the zero base position in the array which is always greater than -1 |
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 // credit: http://stackoverflow.com/questions/11330480/strip-php-variable-replace-white-spaces-with-dashes | |
function seoUrl($string) { | |
//Lower case everything | |
$string = strtolower($string); | |
//Make alphanumeric (removes all other characters) | |
$string = preg_replace("/[^a-z0-9_\s-]/", "", $string); | |
//Clean up multiple dashes or whitespaces | |
$string = preg_replace("/[\s-]+/", " ", $string); | |
//Convert whitespaces and underscore to dash |
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
// the below works from the command line after sshing in (vagrant ssh) | |
mysql -p -u root -h 10.0.2.2 | |
// DB connect creds | |
10.0.2.2 // Hostname of MySQL server | |
root // Username for local MySQL | |
root // Password for local MySQL user | |
database_name // Database name | |
// see here for more: http://stackoverflow.com/questions/24037087/how-do-i-connect-to-my-local-macbook-mysql-form-vagrant-vm-box |
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
.sr-only { | |
position: absolute; | |
width: 1px; | |
height: 1px; | |
padding: 0; | |
margin: -1px; | |
overflow: hidden; | |
clip: rect(0,0,0,0); | |
border: 0; | |
} |
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
/* Must include Font Awesome (here: https://fortawesome.github.io/Font-Awesome/get-started/) for icons to show up */ | |
.slick-prev, | |
.slick-next { | |
font-size: 0; | |
position: absolute; | |
bottom: 20px; | |
color: #d5122f; | |
border: 0; | |
background: none; |
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
// credit http://stackoverflow.com/questions/3740152/how-to-set-chmod-for-a-folder-and-all-of-its-subfolders-and-files-in-linux-ubunt | |
find . -type d -exec chmod 755 {} \; | |
find . -type f -exec chmod 644 {} \; |
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
// make phone number at checkout not required | |
add_filter( 'woocommerce_billing_fields', 'jwd_filter_phone' ); | |
function jwd_filter_phone( $address_fields ) { | |
$address_fields['billing_phone']['required'] = false; | |
return $address_fields; | |
} |
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 | |
/** | |
* Template for ordering custom post types by terms on | |
* on the post types archive.php | |
* | |
* @package WordPress | |
* @author Justin Kopepasah | |
* | |
*/ |
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
.em-calendar-wrapper table { | |
background:#eaeaea; | |
width:100%; | |
border:3px solid #BF2E0D; | |
border-spacing: 0; | |
border-collapse: collapse; | |
} | |
.em-calendar-wrapper table thead td { | |
padding:0; |