$ git checkout --orphan svn
$ svn co https://plugins.svn.wordpress.org/search-by-algolia-instant-relevant-results/ .
#!/bin/bash | |
# works with a file called VERSION in the current directory, | |
# the contents of which should be a semantic version number | |
# such as "1.2.3" | |
# this script will display the current version, automatically | |
# suggest a "minor" version update, and ask for input to use | |
# the suggestion, or a newly entered value. |
FROM php:5.6-fpm | |
RUN curl -L -o /tmp/xdebug-2.3.3.tgz http://xdebug.org/files/xdebug-2.3.3.tgz \ | |
&& tar xfz /tmp/xdebug-2.3.3.tgz \ | |
&& rm -r /tmp/xdebug-2.3.3.tgz \ | |
&& mv xdebug-2.3.3 /usr/src/php/ext/xdebug \ | |
&& docker-php-ext-install xdebug | |
CMD ["php-fpm"] |
# Compiled source # | |
################### | |
*.com | |
*.class | |
*.dll | |
*.exe | |
*.o | |
*.so | |
# Packages # |
search.templatesConfig.helpers.relevantContent = function() { | |
var attributes = ['content', 'title6', 'title5', 'title4', 'title3', 'title2', 'title1']; | |
var attribute_name; | |
for ( var index in attributes ) { | |
attribute_name = attributes[ index ]; | |
if ( this._highlightResult[ attribute_name ].matchedWords.length > 0 ) { | |
return this._snippetResult[ attribute_name ].value; | |
} | |
} |
<?php | |
class Algolia_Page_Templates | |
{ | |
/** | |
* The array of templates that this plugin tracks. | |
*/ | |
protected $templates; | |
/** |
<?php | |
function adjust_curl_timeout( $handle, $r, $url ) { | |
if ( ! isset( $r['timeout'] ) ) { | |
return; | |
} | |
$timeout = $r['timeout']; | |
if( ! is_float( $timeout ) ) { | |
return; |
// @see number to string, pluginized from http://stackoverflow.com/questions/5529934/javascript-numbers-to-words | |
// @see http://stackoverflow.com/questions/20425771/how-to-replace-1-with-first-2-with-second-3-with-third-etc | |
const convert = function (num) { | |
return num2str.convert(num); | |
} | |
const num2str = {} | |
num2str.ones=['','one','two','three','four','five','six','seven','eight','nine']; | |
num2str.tens=['','','twenty','thirty','forty','fifty','sixty','seventy','eighty','ninety']; |
#!/usr/bin/env node | |
var algoliasearch = require('algoliasearch'); | |
const APP_ID = 'whatever'; | |
const API_KEY = 'whatever'; | |
const INDEX_NAME = "test"; | |
var client = algoliasearch(APP_ID, API_KEY); | |
var index = client.initIndex(INDEX_NAME); |