Skip to content

Instantly share code, notes, and snippets.

View harikt's full-sized avatar
⛱️
Tanvish Technologies

Hari K T harikt

⛱️
Tanvish Technologies
View GitHub Profile
@harikt
harikt / SplClassLoader.php
Created February 19, 2012 17:01 — forked from jwage/SplClassLoader.php
PSR-0 autoloader implementation
<?php
/**
* SplClassLoader implementation that implements the technical interoperability
* standards for PHP 5.3 namespaces and class names.
*
* https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-0.md
*
* // Example which loads classes for the Doctrine Common package in the
* // Doctrine\Common namespace.
@harikt
harikt / index.html.php
Created August 4, 2012 14:50 — forked from webmozart/composer.json
Symfony 2.1 stand-alone form usage with PHP templates
<html>
<head>
<title>Standalone Form Component</title>
</head>
<body>
<form action="#" method="post">
<?php echo $view['form']->widget($form); ?>
<input type="submit" />
</form>
</body>
public function value(&$value, $method, $name)
{
// get the params
$params = func_get_args();
array_shift($params); // $value
array_shift($params); // $method
array_shift($params); // $name
// set up the field name and data
$field = 'field';
@harikt
harikt / spider.php
Created September 23, 2012 14:59 — forked from ralphschindler/spider.php
Script to be used with PHP's built-in webserver to proxy and spider a site on click
<?php
// start PHP with: php -S localhost:8888 -t . spider.php
$site = 'http://www.targetwebsite.org/';
$path = $_SERVER["REQUEST_URI"];
if ($path == '/') {
$path = '/index.html';
// Require the file
$class = "ClassName";
$r = new ReflectionClass($class);
$str = '';
foreach($r->getMethods(ReflectionMethod::IS_PUBLIC) as $method) {
$rm = new ReflectionMethod($class, $method->name);
$pieces = array();
foreach($rm->getParameters() as $params ) {
# originally from Joe Stump at Digg
for i in `$SVNLOOK changed -t "$TXN" "$REPOS" | /usr/bin/awk '{print $2}'`
do
if [ ${i##*.} == php ]; then
CHECK=`$SVNLOOK cat -t "$TXN" "$REPOS" $i | /usr/bin/php5 -d html_errors=off -l || echo $i`
RETURN=`echo $CHECK | /bin/grep "^No syntax" > /dev/null && echo TRUE || echo FALSE`
if [ $RETURN = 'FALSE' ]; then
echo $CHECK 1>&2;
exit 1
StaticFile {
Extensions {
123 = application/vnd.lotus-1-2-3
3dml = text/vnd.in3d.3dml
3ds = image/x-3ds
3g2 = video/3gpp2
3gp = video/3gpp
7z = application/x-7z-compressed
aab = application/x-authorware-bin
aac = audio/x-aac
<?php
/**
* Send reconfigure=1 as a GET param to configure the example correctly.
* Omit to see the results from PHP's default SSL context settings.
* This example script reflects output from https://www.howsmyssl.com.
*/
$reconfigure = isset($_GET['reconfigure']) ? (bool) $_GET['reconfigure'] : false;
/**
* https://wiki.mozilla.org/Security/Server_Side_TLS#Recommended_Ciphersuite
*/
<?php
function it($m,$p){echo ($p?'✔︎':'✘')." It $m\n"; if(!$p){$GLOBALS['f']=1;}}function done(){if(@$GLOBALS['f'])die(1);}