Skip to content

Instantly share code, notes, and snippets.

View filbertkm's full-sized avatar
😺

Katie Filbert filbertkm

😺
View GitHub Profile
{
"description": "full_text search for 'life'",
"path": "wikidatawiki_content\/page\/_search",
"params": {
"timeout": "20s"
},
"query": {
"_source": [
"id",
"title",
@filbertkm
filbertkm / cirrus-config.php
Created January 20, 2016 17:42
cirrus config
<?php
$wgSearchType = 'CirrusSearch';
$wgCirrusSearchShowNowUsing = true;
$wgCirrusSearchMoreAccurateScoringMode = false;
$wgCirrusSearchRefreshInterval = 30;
$wgCirrusSearchSearchShardTimeout[ 'regex' ] = '20s';
$wgCirrusSearchClientSideSearchTimeout[ 'regex' ] = 30;
$wgJobBackoffThrottling['cirrusSearchLinksUpdate'] = 5000;
/**
* Constructor
* @param IContextSource $context IContextSource to inherit from
*/
public function __construct( IContextSource $context ) {
if ( ! ( $context instanceof MutableContext ) ) {
$context = $this->getMutableContextFromIContextSource( $context );
}
// Clone the original context object so we can change it without changing the
class TextContent extends AbstractContent {
/**
* Returns the text represented by this Content object, as a string.
*
* @return string The raw text.
*/
public function getTextForSearchIndex() {
return $this->getNativeData();
}
array (
'pageinfo' =>
array (
'lastrevid' => 23444,
),
'success' => 1,
'claim' =>
array (
'mainsnak' =>
array (
http://api.bls.gov/publicAPI/v2/timeseries/data/LAUST370000000000003
Local Area Unemployment Statistics
Survey Overview The following is a sample format description of the Local Area Unemployment Statistics' series identifier:
1 2
12345678901234567890
Series ID LAUCN281070000000003
Positions Value Field Name
1-2 LA Prefix
#!/bin/sh
if [ ! -z $1 ]
then
git blame -M -w $1 | perl -n -e '/^.*\((.*?)\s*[\d]{4}/; print $1,"\n"' | sort -f | uniq -c | sort -n
else
git ls-files -z | xargs -0n1 git blame -M -w | perl -n -e '/^.*\((.*?)\s*[\d]{4}/; print $1,"\n"' | sort -f | uniq -c | sort -n
fi
@filbertkm
filbertkm / gist:9502604
Created March 12, 2014 07:53
subquery in mediawiki
$select = $this->dbw->selectSQLText(
'user_properties',
array( 'up_user', 'up_property', 'up_value', 'count(up_user) as count' ),
'up_property=' . $this->dbw->addQuotes( $oldOption ) . ' OR up_property = ' . $this->dbw->addQuotes( $newOption ),
__METHOD__,
array( 'GROUP BY' => 'up_user' )
);
$result = $this->dbw->select(
"( $select ) as user_props",
@filbertkm
filbertkm / gist:6636631
Last active December 23, 2015 12:39
enwiki interwiki.cdb
__global:abbenormal http://johnabbe.wagn.org/$1 0
__global:acronym http://www.acronymfinder.com/af-query.asp?String=exact&Acronym=$1 0
__global:advisory //advisory.wikimedia.org/wiki/$1 1
__global:advogato http://www.advogato.org/$1 0
__global:aew http://wiki.arabeyes.org/$1 0
__global:appropedia http://www.appropedia.org/$1 0
__global:aquariumwiki http://www.theaquariumwiki.com/$1 0
__global:arborwiki http://arborwiki.org/city/$1 0
__global:arxiv http://arxiv.org/abs/$1 0
__global:atmwiki http://www.otterstedt.de/wiki/index.php/$1 0
(function() {
var notices = {
WiknicUS:
{
begin: '7 May 2013 00:00 UTC',
end: '23 June 2013 00:00 UTC',
country: 'US',
text: "Join the [[Wikipedia:Wiknic|Great American Wiknic]], a Wiki-Picnic being celebrated in 10+ US cities around June 22!"
},