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 / tmux-cheatsheet.markdown
Last active August 29, 2015 14:27 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@harikt
harikt / stream.md
Last active August 29, 2015 14:26
PSR-7 Streams and usage of setting the file to be downloaded without explicitly making it to an implementation like zend-diactoros.

Hi,

I was looking a small piece of code

$file = new SplFileObject($path);
while (! $file->eof()) {
   echo $file->fgets();
}
@harikt
harikt / router.php
Last active August 29, 2015 14:24
Aura.Router v2 default route with wildcard question on irc.
<?php
// router instantiation
$router->add('default_route', '/{controller}')
->setWildcard('other')
->addValues(array(
'action' => 'build_your_controller',
));
;
<?php
$client = new Client(
array(
'base_url' => \SproutVideo::$base_url,
'defaults' => array(
'headers' => array(
'SproutVideo-Api-Key' => \SproutVideo::$api_key,
'Content-Type', 'application/json;charset=utf-8'
),
)
@harikt
harikt / symfony.md
Last active August 29, 2015 14:23
Symfony documentation tips
<?php
// front-end form example with multiple images upload
// add new page created on the fly and adding images
$message = '';
if($input->post->submit){
// tmp upload folder for additional security
<?php
/**
* ProcessWire (2.5) InputfieldFile front-end upload form example
* Various workarounds to get it working with Errors for WireUpload
* and removing files upload after error
*/
$sent = false;
$upload_path = $config->uploadTmpDir;
<?php
// front-end form example with multiple images upload
// add new page created on the fly and adding images
$message = '';
if($input->post->submit){
// tmp upload folder for additional security
@harikt
harikt / from.php
Last active August 29, 2015 14:22 — forked from somatonic/from.php
<?php
// get a page
$editpage = $pages->get("/editme/");
$ignorefields = array("isOld","language_published");
$form = $modules->get("InputfieldForm");
$form->method = 'post';
$form->action = './';
@harikt
harikt / Filter.php
Created April 21, 2015 11:29
Aura.Input
<?php
/**
*
* This file is part of the Aura project for PHP.
*
* @package Aura.Input
*
* @license http://opensource.org/licenses/bsd-license.php BSD
*
*/