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 | |
class test extends GtkAssistant { | |
public $entry; | |
public $view; | |
public function __construct() { | |
parent::__construct(); |
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 colorize($img,$color) { | |
$fill = new Imagick; | |
$fill->newImage( | |
$img->getImageWidth(), | |
$img->getImageHeight(), | |
$color | |
); |
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 | |
/* assuming the config file has been set to load the surface library, and to | |
automatically run the surface for us, this would result in a complete page | |
output to the browser in the current site theme. it would say, 'lol', lol. */ | |
require('m/application.php'); | |
echo 'lol'; | |
?> |
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 is assuming we have a database configured in the config file under the | |
alias of 'default' - for this example we assume it is MySQL. */ | |
require('m/application.php'); | |
$db = new m/database; | |
$id = 42; | |
// when using the queryf method of the database library, all format arguments |
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 | |
$img = new Imagick('input.png'); | |
$img->setImageOpacity(0.25); | |
$img->writeImage('output.png'); | |
$img->destroy(); | |
?> |
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 bob_opacity($img,$alpha) { | |
if(!is_object($img)) return false; | |
if($alpha > 1 || $alpha < 0) return false; | |
$rows = $img->getPixelIterator(); | |
foreach($rows as $cols) { | |
foreach($cols as $pixel) { | |
// we now have an object pointing at a single pixel of the image |
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
LogFormat "{ \"Time\":%{%s}t, \"RemoteIP\":\"%a\", \"Host\":\"%V\", \"Port\":\"%p\", \"Request\":\"%U\", \"Query\":\"%q\", \"File\":\"%f\", \"Method\":\"%m\", \"Status\":\"%s\", \"UserAgent\":\"%{User-agent}i\", \"Referer\":\"%{Referer}i\" }" jsonlog | |
CustomLog "/var/log/apache2/access-json.log" jsonlog |
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 | |
$file = new SplFileObject('/var/log/apache/access-json.log'); | |
$file->setFlags(SplFileObject::DROP_NEW_LINE); | |
foreach($file as $line) { | |
if(!$line) continue; | |
$log = json_decode($line); | |
if(!is_object($log)) continue; |
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 | |
// sort of psuedo, but a basic image class. | |
/* | |
$img = new image($file); | |
$img->scale(640,480)->crop(64,64,128,128); | |
*/ | |
class image { |
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 | |
class BobWindow extends GtkWindow { | |
public function __construct() { | |
parent::__construct(); | |
$this->set_size_request(256,256); | |
$this->set_title('BobWindow'); | |
$this->set_position(Gtk::WIN_POS_CENTER); |
OlderNewer