Skip to content

Instantly share code, notes, and snippets.

View prashants's full-sized avatar
💭
I may be slow to respond.

Prashant Shah prashants

💭
I may be slow to respond.
  • Developer
  • Mumbai, India
View GitHub Profile
public function eclone($entrytypeLabel = null, $id = null) {
/* Check for valid entry type */
if (!$entrytypeLabel) {
$this->Session->setFlash(__d('webzash', 'Entry type not specified.'), 'danger');
return $this->redirect(array('plugin' => 'webzash', 'controller' => 'entries', 'action' => 'index'));
}
$entrytype = $this->Entrytype->find('first', array('conditions' => array('Entrytype.label' => $entrytypeLabel)));
if (!$entrytype) {
$this->Session->setFlash(__d('webzash', 'Entry type not found.'), 'danger');
@prashants
prashants / filter.c
Created October 5, 2012 11:48
Filter driver
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/module.h>
#include <linux/fs.h>
#include <linux/blkdev.h>
#include <linux/cdev.h>
#include <linux/kthread.h>
#include <linux/interrupt.h>
#include <linux/bio.h>
#include <linux/blkdev.h>
@prashants
prashants / lwnfs.c
Created August 28, 2012 10:07
Updated lwnfs
/*
* Demonstrate a trivial filesystem using libfs.
*
* Copyright 2002, 2003 Jonathan Corbet <corbet@lwn.net>
* This file may be redistributed under the terms of the GNU GPL.
*
* Chances are that this code will crash your system, delete your
* nethack high scores, and set your disk drives on fire. You have
* been warned.
*/