Skip to content

Instantly share code, notes, and snippets.

@SemanticallyNull
SemanticallyNull / gist:3435433
Created August 23, 2012 10:49 — forked from idan/gist:3135754
A Sample Post

Hello there! This is a sample post for gist.io, a super-lightweight writing soapbox for hackers.

Now look up. Further. Above the post title. See that grey text with the gist ID?

Now back to me. That grey text is a link! Open that sucker in a new tab to see the source for this post. Also, I'm on a horse.

This is a major heading

If you peek at it with a web inspector, you'll see that it is a second-level heading. You can use first level headings, but they'll look just like the second level ones, and the gods of the HTML5 outlining algorithm will frown upon you.

<?php phpinfo(); ?>
<?php
echo "Domain 1";
<?php
echo "Domain 2";
<?php
echo "Some test stuff";
trigger_error("This is a test - trigger_error()", E_USER_ERROR);
syslog(LOG_ERR, "This is a test - syslog()");
<?php
var_dump(! empty($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) !== 'off');
@SemanticallyNull
SemanticallyNull / filter_var.php
Created November 9, 2012 15:14
filter_var() example
<?php
$options = array('options'=>array(
'min_range' => 1,
'max_range' => 5,
'default' => 3
));
$_GET['grievous'] = filter_var($_GET['grievous'], FILTER_VALIDATE_INT, $options);
function TestController() {
var iansFunction = function() { return true; }
iansFunction(); // returns true
}
iansFunction(); // returns uncallable
<?php
var_dump($_SERVER['HTTP_HOST']);
<?php
header("X-Orchestra-Server: app1-new");
phpinfo();