Skip to content

Instantly share code, notes, and snippets.

@dereckson
dereckson / ForcePurgeAction
Created Jan 2, 2013
Allows MediaWiki to force purge for anonymous requests, with ?action=purge&forcepurge=1. This is intended to be used when generating links webcrawlers shouldn't get.
View ForcePurgeAction
diff --git a/includes/actions/PurgeAction.php b/includes/actions/PurgeAction.php
index cd58889..5a8cc6f 100644
--- a/includes/actions/PurgeAction.php
+++ b/includes/actions/PurgeAction.php
@@ -61,7 +61,8 @@ class PurgeAction extends FormAction {
// This will throw exceptions if there's a problem
$this->checkCanExecute( $this->getUser() );
- if ( $this->getUser()->isAllowed( 'purge' ) ) {
+ $forcePurge = isset( $_GET['forcepurge'] ) && ( $_GET['forcepurge'] == 1 );
@dereckson
dereckson / FingerClient.php
Created Sep 18, 2013
Finger client in PHP.
View FingerClient.php
<?php
/**
* Finger client
*/
class FingerClient {
/**
* The finger remote server
* @var string
*/
View QuestionMark.js
/* -------------------------------------------------------------
Keyboard shorcuts help
Based on QuestionMark.js by Louis Lazaris
http://impressivewebs.github.io/QuestionMark.js/
CC-BY 2.0 license with additional waiver 'no credit required'
Port to Dojo 1.9 by Dereckson
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
@dereckson
dereckson / SystematicElementName.php
Last active Aug 29, 2015
Determine a systematic element name
View SystematicElementName.php
<?php
/**
* Represents a systematic element name
*/
class SystematicElementName {
/**
* Gets the root matching the digit
*
* @param int $digit The digit
@dereckson
dereckson / ReplicationDatabaseFactory.php
Last active Aug 29, 2015
Provides access to MySQL improved instances connected to Wikimedia Tool Labs replication databases
View ReplicationDatabaseFactory.php
<?php
/**
* Provides access to MySQL improved instances connected to Wikimedia Tool Labs replication databases
*/
class ReplicationDatabaseFactory {
/**
* Hashtable of stored resources
*
* @var Array each item is a mysqli instance
View -
#!/bin/sh
#
# Nasqueron Tools deployment script
#
#Config
GIT=/usr/local/bin/git
WWW=/var/wwwroot/nasqueron.org/tools
REPO=/home/dereckson/dev/nasqueron/tools/repo
REPOUSER=dereckson
View -
<?php
/**
* Nasqueron Tools
*
* Router script to use built-in PHP server
*
* @package NasqueronTools
* @author Sébastien Santoro aka Dereckson <dereckson@espace-win.org>
* @license http://www.opensource.org/licenses/bsd-license.php BSD
@dereckson
dereckson / PhpFpmEnvironment.php
Last active Aug 29, 2015
php-fpm-env > /usr/local/etc/env.conf
View PhpFpmEnvironment.php
#!/usr/bin/env php
<?php
/**
* Allows to get the content of a php-fpm environment configuration file
*/
class PhpFpmEnvironment {
/**
* The temporary directory, used in TMP, TEMP and TMPDIR environment variables
* @var string
@dereckson
dereckson / Makefile
Last active Aug 29, 2015
Use of usleep to idle a thread and avoid full CPU core use.
View Makefile
all: idle-on idle-off
idle-on:
${CC} -DIDLE idle_test.c -o idle-on
idle-off:
${CC} idle_test.c -o idle-off
clean:
rm -f *.o idle-on idle-off
@dereckson
dereckson / proof.md
Last active Nov 20, 2016
Keybase proof
View proof.md

Keybase proof [36/90]

I hereby claim:

  • I am dereckson on github.
  • I am dereckson (https://keybase.io/dereckson) on keybase.
  • I have a public key whose fingerprint is 1E16 E1A7 0417 6257 76FA 944D 34A4 3097 536F 1E8D

To claim this, I am signing this object: