This file contains hidden or 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 | |
$google_reader = new GoogleReaderAPI( '[email protected]', 'password' ); | |
$unread_items = $google_reader ->get_unread(50); | |
foreach( $unread_items -> items as $val ){ | |
//print_r( $val ); | |
$ar_news = array( | |
'title' => $val -> title, |
This file contains hidden or 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 url_exists($url) { | |
$headers = @get_headers($url); | |
return ($headers[0] == 'HTTP/1.1 200 OK' || $headers[0] == 'HTTP/1.0 200 OK'); | |
} |
This file contains hidden or 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
private void copyDataBase() throws IOException{ | |
// Path to the just created empty db | |
String outFileName = DB_PATH + DB_NAME; | |
//Open the empty db as the output stream | |
OutputStream myOutput = new FileOutputStream(outFileName); | |
//transfer bytes from the inputfile to the outputfile | |
byte[] buffer = new byte[1024]; |
This file contains hidden or 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
generator.enemies = { | |
{ t = 1000, enemyType = 'worm' }, | |
{ t = 3000, enemyType = 'worm' }, | |
{ t = 6000, enemyType = 'worm' }, | |
{ t = 10000, enemyType = 'worm' }, | |
{ t = 10000, enemyType = 'worm' }, | |
{ t = 12000, enemyType = 'worm' }, | |
} |
This file contains hidden or 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
--usefull functions | |
function p(t) | |
print( t ) | |
end | |
--@see http://lua-users.org/wiki/MathLibraryTutorial | |
math.randomseed( os.time() ) | |
_W, _H = display.contentWidth, display.contentHeight |
This file contains hidden or 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
--генератор врагов в точке респауна | |
--создает экземпляры объектов в необходимое время | |
EnemyGenerator = {} | |
function EnemyGenerator:new(params) | |
local generator = {} | |
--координаты появления | |
generator.x = params.x |
This file contains hidden or 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
function bullet:enterFrame(e) | |
if ( self:isOut() ) then | |
self:destroy(); | |
end | |
... | |
self:checkCollision() | |
end | |
This file contains hidden or 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
function bullet:enterFrame(e) | |
if ( self:isOut() ) then | |
self:destroy(); | |
return true; | |
end | |
... | |
self:checkCollision() | |
end |
This file contains hidden or 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
function bullet:enterFrame(e) | |
if (self.destroyed) then | |
self:destroy() | |
return true; | |
end | |
if ( self:isOut() ) then | |
self.destroyed = true; | |
end | |
This file contains hidden or 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 | |
//парсинг баша.орг.ру | |
#error_reporting(0); | |
set_time_limit(0); | |
ini_set('memory_limit', '512M'); | |
$db = new SQLite3('bash'); | |
#$db->query('DELETE FROM quotes;'); |
OlderNewer