Skip to content

Instantly share code, notes, and snippets.

@dereckson
dereckson / app.js
Created March 20, 2017 23:11
Code to parse a JSON document, decorate with relevant links and print a server log
"use strict";
/* -------------------------------------------------------------
Nasqueron infrastructure
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Project: Nasqueron
Author: Sébastien Santoro aka Dereckson
Dependencies: jQuery
Filename: app.js
Licence: CC-BY 4.0, MIT, BSD-2-Clause (multi-licensing)
@dereckson
dereckson / proof.md
Last active November 20, 2016 12:11
Keybase proof

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:

Verifying that +dereckson is my blockchain ID. https://onename.com/dereckson
/* -------------------------------------------------------------
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 / ForcePurgeAction
Created January 2, 2013 22:37
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.
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 / Makefile
Last active August 29, 2015 14:21
Use of usleep to idle a thread and avoid full CPU core use.
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 / PhpFpmEnvironment.php
Last active August 29, 2015 14:19
php-fpm-env > /usr/local/etc/env.conf
#!/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 / -
Created November 23, 2014 11:14
<?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 / -
Created November 23, 2014 11:13
#!/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
@dereckson
dereckson / ReplicationDatabaseFactory.php
Last active August 29, 2015 14:10
Provides access to MySQL improved instances connected to Wikimedia Tool Labs replication databases
<?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