This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//sherpinski triangle fractal generator for PHP | |
//Copyright (C)2015 FutureSight Technologies - all rights reserved, do not copy | |
$iterations = input('Iterations?');; | |
$squaresize = input('Size?'); | |
function input($prompt) { | |
echo $prompt . ' '; | |
$line = fgets(STDIN); | |
return (int)strtok($line, "\n"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php //this example requires usernames to be >= 10 characters when registering | |
$hooks = array(); | |
$hooks['review_registration'] = array( | |
function($args) { | |
global $errors; | |
if (strlen($args['username']) < 10) { | |
$errors[] = 'Your username must be >=10 characters'; | |
return false; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function percentbar($pct) { | |
$pct = floor($pct); | |
$half = false; | |
for ($j = 1; $j <= 50; $j++) { | |
if ($j > 22 && $j < 27) { | |
if (!$half) { | |
echo '[' . sprintf('%2d', $pct) . '%]'; | |
$half = true; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$data = file_get_contents('http://wiki.scratch.mit.edu/w/api.php?action=query&titles=Scratch%20Wiki:Votes%20For%20Admin%202013&prop=revisions&rvprop=content&format=xml&salt=' . md5(time())); | |
$xml = new SimpleXMLElement($data); | |
$votes = (string) ($xml->query->pages->page->revisions->rev); | |
$lines = explode("\n", $votes); | |
$vote_lines = array(); | |
foreach ($lines as $val) { | |
if (preg_match('%^\| *[A-z]%msi', $val)) { | |
$vote_lines[] = $val; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//See https://lists.wikimedia.org/pipermail/mediawiki-l/2009-June/031231.html for what I modeled this after | |
//add the following code to the end of your LocalSettings.php file | |
function restrictBlockList(&$list) { | |
global $wgUser; | |
if (!$wgUser->isAllowed('block')) { | |
unset($list['BlockList']); | |
} | |
} | |
$wgHooks['SpecialPage_initList'][]='restrictBlockList'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#cs ---------------------------------------------------------------------------- | |
AutoIt Version: 3.3.6.1 | |
Author: jvvg Industries Corporation | |
Script Function: | |
To create a programming interface. | |
Script Title: | |
Advanced Computer Integrated Development |
This file has been truncated, but you can view the full file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
100-Pronunciation Analysing-comparing for ESL students | |
1000-Right Here Waiting Karaoke | |
10000-subject of projects | |
100000-iScribble? | |
100001-PeteCraft [BukkitPro Needed] [Hamachi] | |
100002-Sprite Problems | |
100003-Fighting with a different style. | |
100004-Want to Add one of Your Projects to our Project Library Today? | |
100005-Basketball Engine Collaboration | |
100006-Hilarious Video: Team Fortress 2 Meets Wrestler Interview |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* From a line in the signature, extract all the users linked to | |
* | |
* @param string $line Line of text potentially including linked user, user talk, | |
* and contribution pages | |
* @return string[] array of usernames, empty array for none detected | |
*/ | |
public static function extractUsersFromLine( $line ) { | |
/* | |
* Signatures can look like anything (as defined by i18n messages |