Skip to content

Instantly share code, notes, and snippets.

Avatar
🙂

Hari K T harikt

🙂
View GitHub Profile
View Renderer.php
<?php
namespace Aura\Web_Kernel;
class Renderer
{
public $data;
public $renderer;
public $view;
View checksslcontext.php
<?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
*/
@harikt
harikt / inner.php
Last active Aug 29, 2015
Aura.View standalone.
View inner.php
<div> I should be in "main" something else </div>
<?php
// the view template
// set a new variable into the data
$this->title = 'Example Two-Step View';
// show the same view output as before
echo '<p>Hello ' . $this->escapeHtml($this->name) . '. '
. 'Your email address is ' . $this->escapeHtml($this->email) . '.</p>';
?>
View TestFrameworkInATweet.php
<?php
function it($m,$p){echo ($p?'✔︎':'✘')." It $m\n"; if(!$p){$GLOBALS['f']=1;}}function done(){if(@$GLOBALS['f'])die(1);}
@harikt
harikt / update.sh
Created Mar 1, 2014
apigility error on update
View update.sh
Zend\Mvc\Router\Exception\RuntimeException
File:
/var/www/apigility/vendor/zendframework/zendframework/library/Zend/Mvc/Router/Http/TreeRouteStack.php:317
Message:
Route with name "zf-apigility-welcome" not found
View oembed.php
<?php
$url = 'https://twitter.com/dhrrgn/status/440968615697715200';
$embedly = new Embedly\Embedly([
'key' => getenv('EMBEDLY_KEY'),
]);
if (preg_match('#https?://(?:www.)?twitter.com/[^/]+/status/([0-9]+)#i', $url, $match)) {
$oembed = json_decode(file_get_contents('https://api.twitter.com/1/statuses/oembed.json?id='.$match[1]), true);
View deploy
#!/bin/bash
# This deploy hook gets executed after dependencies are resolved and the
# build hook has been run but before the application has been started back
# up again. This script gets executed directly, so it could be python, php,
# ruby, etc.
export COMPOSER_HOME="$OPENSHIFT_DATA_DIR/.composer"
if [ ! -f "$OPENSHIFT_DATA_DIR/composer.phar" ]; then
curl -s https://getcomposer.org/installer | php -- --install-dir=$OPENSHIFT_DATA_DIR
@harikt
harikt / Commom.php
Last active Aug 29, 2015
Aura.View Router Helper
View Commom.php
<?php
namespace Aura\Framework_Project\_Config;
use Aura\Di\Config;
use Aura\Di\Container;
class Common extends Config
{
public function define(Container $di)
{
View paginator.php
<?php
/**
* include paginator class from ProcessWire core, $config->paths->Modulename can
* be used to get the path of any module in PW.
*/
require_once($config->paths->MarkupPagerNav . "PagerNav.php");
/**
@harikt
harikt / cookie1.php
Created May 15, 2014
Something is wrong. But now working fine
View cookie1.php
<?php
if (isset($_COOKIE['counter'])) {
$counter = $_COOKIE['counter'];
echo $counter;
$counter++;
setcookie('counter', $counter, time() + 60*60*24*30, '/', '', false, true);
} else {
setcookie('counter', 1, time() + 60*60*24*30, '/', '', false, true);
}