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 | |
echo chr(27) . '[32m' . "This is a green line" . chr(27) . '[0m' . "\n"; | |
echo chr(27) . '[31m' . "This is a red line" . chr(27) . '[0m' . "\n"; | |
function move_right($x) { echo chr(27) . "[{$x}C"; sleep(1); } | |
function move_left($x) { echo chr(27) . "[{$x}D"; sleep(1); } | |
function move_up($x) { echo chr(27) . "[{$x}A"; sleep(1); } |
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 | |
$strings = array("racecar", "bob", "b", "abc", "car", "mom", "diary", null, ''); | |
foreach ($strings as $str) { | |
if (palindrome($str)) { | |
print "$str is a palindrome\n"; | |
} else { | |
print "$str is NOT a palindrome\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
lib/jabber/bot.rb | |
204,208d203 | |
< @jabber.roster.add_subscription_request_callback do |item,pres| | |
< @jabber.roster.accept_subscription(pres.from) | |
< puts 'accepted request from ' + pres.from.to_s | |
< end | |
NewerOlder