=INDEX('[Healh-Factor-product list_Health-lookup.xlsx]Sheet1'!$A:$A,MATCH(""&TRIM(E313)&"",'[Healh-Factor-product list_Health-lookup.xlsx]Sheet1'!$D:$D,),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
for file in *.po; do | |
po-to-xls ${file%.*}.po -o ${file%.*}.xlsx | |
done | |
# https://stackoverflow.com/questions/2664740/extract-file-basename-without-path-and-extension-in-bash | |
# $file is the file original name | |
# no extension: ${file%.*}.po | |
# s=/the/path/foo.txt | |
# echo "${s##*/}" | |
# foo.txt |
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 to export data in all sheets in the current spreadsheet as individual csv files | |
* files will be named according to the name of the sheet | |
* Note: This script uses the DocsList.createFile() method, which is only available for Google Apps accounts. | |
* author: Michael Derazon | |
*/ | |
function onOpen() { | |
var ss = SpreadsheetApp.getActiveSpreadsheet(); | |
var csvMenuEntries = [{name: "export as csv files", functionName: "saveAsCSV"}]; |
// reset table id from 1 ALTER TABLE tablename AUTO_INCREMENT = 1
MySQL multiple columns in IN clause https://stackoverflow.com/questions/44706196/mysql-multiple-columns-in-in-clause (x0, y0, x1, y1) IN ((4, 3, 5, 6),(9, 3, 2, 1))
for string, need to be ... IN ('something1', 'something2') ...
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 | |
var_dump($this->request); | |
if( strpos( $this->request, 'SQL_CALC_FOUND_ROWS' ) > 0 ) { | |
file_put_contents('/volumes/ram/test_'. time() .'.txt', $this->request); | |
} |
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 | |
// $post = get_post( 33, OBJECT ); // use ID or | |
$post = get_page_by_path( $path ); // url path such as /people/staff or /people/staff/ both work | |
setup_postdata( $post ); // change global post object | |
$post->ID; // new ID | |
wp_reset_postdata(); // reset to original post data | |
?> |
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
Each YouTube video has 4 generated images. They are predictably formatted as follows: | |
http://img.youtube.com/vi/<insert-youtube-video-id-here>/0.jpg | |
http://img.youtube.com/vi/<insert-youtube-video-id-here>/1.jpg | |
http://img.youtube.com/vi/<insert-youtube-video-id-here>/2.jpg | |
http://img.youtube.com/vi/<insert-youtube-video-id-here>/3.jpg | |
The first one in the list is a full size image and others are thumbnail images. The default thumbnail image (ie. one of 1.jpg, 2.jpg, 3.jpg) is: | |
http://img.youtube.com/vi/<insert-youtube-video-id-here>/default.jpg |
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 | |
/** | |
* [list_searcheable_acf list all the custom fields we want to include in our search query] | |
* @return [array] [list of custom fields] | |
*/ | |
function list_searcheable_acf(){ | |
$list_searcheable_acf = array("title", "sub_title", "excerpt_short", "excerpt_long", "xyz", "myACF"); | |
return $list_searcheable_acf; | |
} |
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 sing_update_post_types_support() { | |
// add_post_type_support( 'events', 'post-formats' ); | |
} | |
add_action( 'init', 'sing_update_post_types_support' ); |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"> | |
</script> | |
<meta charset='utf-8' /> | |
<title> | |
infinite loop carousel(horizontal) | |
</title> |