Skip to content

Instantly share code, notes, and snippets.

View sebastianmarzjan's full-sized avatar

Sebastian Marzjan sebastianmarzjan

View GitHub Profile
@sebastianmarzjan
sebastianmarzjan / compareCaches.php
Last active May 10, 2016 09:04
CDB dump comparer
<?php
error_reporting(E_ALL);
ini_set('display_errors','On');
function checkLang($lang) {
$s1 = unserialize(file_get_contents('./dump_dev/messageCache.dump.' . $lang . '.php'));
$s2 = unserialize(file_get_contents('./dump_374/messageCache.dump.' . $lang . '.php'));
$k1 = array_keys($s1);
@sebastianmarzjan
sebastianmarzjan / checkMessageCache.php
Last active May 10, 2016 09:04
Run from /usr/wikia/slot1/current/maintenance with $sudo SERVER_ID=177 php checkMessageCache.php
<?php
require_once( dirname( __FILE__ ) . '/commandLine.inc' );
error_reporting( E_ALL );
ini_set( 'display_errors', 'On' );
foreach ( Language::getLanguageNames() as $languageCode => $languageName ) {
$lang = Language::factory( $languageCode );
$mc = $lang->getLocalisationCache();
@sebastianmarzjan
sebastianmarzjan / FeaturedPromoChecks.php
Created June 4, 2014 17:38
FeaturedPromoChecks.php
<?php
require_once(dirname( __FILE__ ) . '../../../Maintenance.php');
class PromoteChecks extends Maintenance {
/**
* Set script options
*/
public function __construct() {
@sebastianmarzjan
sebastianmarzjan / PromoteUserChecks.php
Created June 4, 2014 11:22
PromoteUserChecks.php
<?php
require_once(dirname( __FILE__ ) . '../../../Maintenance.php');
class PromoteUserChecks extends Maintenance {
/**
* Set script options
*/
public function __construct() {
public function rssFeed() {
global $wgDatamartDB;
$wikiId = $this->getVal( 'wikiId' );
$wikis = [$wikiId];
$rec_list = [];
foreach ($wikis as $community) {
$pages = [];
(function (window, document, $nirvana) {
// Disable loading spotlights from OpenX
window.wgEnableOpenXSPC = false;
$nirvana.sendRequest({
controller: 'SpotlightsABTest',
method: 'getSpotlights',
type: 'post',
format: 'json',
data: {