Skip to content

Instantly share code, notes, and snippets.

View piyuesh23's full-sized avatar

Piyuesh Kumar piyuesh23

View GitHub Profile
@piyuesh23
piyuesh23 / gist:1216448
Created September 14, 2011 12:36 — forked from ngmaloney/gist:981766
my.drush.inc
<?php
/**
* @file My Drush Commands
*/
/**
* Implementation of hook_drush_help()
*/
function my_drush_help($section) {
switch ($section) {
<?xml version="1.0" encoding="UTF-8"?>
<buildpath>
<buildpathentry kind="src" path=""/>
<buildpathentry kind="con" path="org.eclipse.php.core.LANGUAGE"/>
</buildpath>
@piyuesh23
piyuesh23 / Update_user
Last active August 29, 2015 14:02
Sets user field to a specific value.
$results = db_select('users', 'u')
->fields('u', array('uid', 'created'))
->condition('uid', 0, '<>')
->condition('uid', 1, '<>')
->range(0,300)
->orderBy('created')
->execute()->fetchAll();
foreach($results as $result) {
$user = user_load($result->uid);
@piyuesh23
piyuesh23 / gist:b577a00d884177e15527
Created July 6, 2014 20:46
Getting sockets to work with /linnovate/mean
### Package.json ###
"socket.io": "0.9.16"
### Bower.json ###
"socket.io-client": "0.9.16"
npm install
bower install
### config/assests.json ###
@piyuesh23
piyuesh23 / ClearAngularForm
Created July 7, 2014 10:03
Clear form on Angular end
### Using Form inside a controller ###
$scope.formName.$setPristine()
### Including a form using ng-include ###
this.formName.$setPristine()
### Resetting data being set using ng-modal###
$scope.modal = ''
@piyuesh23
piyuesh23 / generate_pdf_archived_invoice.php
Created November 20, 2014 10:44
Logic to generate pdf from archived invoices stored in s3
// CONSTANTS defined in whiteboard_migration.module.
// Will be accessible when this module is installed on whiteboard.
define('WHITEBOARD_INVOICE_HEADER_START_COMMENT', 'Header begins here for invoice #');
define('WHITEBOARD_INVOICE_HEADER_END_COMMENT', 'Header ends here for invoice #');
define('WHITEBOARD_INVOICE_BODY_START_COMMENT', 'Body begins here for invoice #');
define('WHITEBOARD_INVOICE_BODY_END_COMMENT', 'Body ends here for invoice #');
define('WHITEBOARD_INVOICE_FOOTER_START_COMMENT', 'Footer begins here for invoice #');
define('WHITEBOARD_INVOICE_FOOTER_END_COMMENT', 'Footer ends here for invoice #');
$header_start_comment = '<!--' . WHITEBOARD_INVOICE_HEADER_START_COMMENT . $invoice_vid . '-->';
@piyuesh23
piyuesh23 / generate_pdf_archived_invoice.php
Created November 20, 2014 10:44
Logic to generate pdf from archived invoices stored in s3
// CONSTANTS defined in whiteboard_migration.module.
// Will be accessible when this module is installed on whiteboard.
define('WHITEBOARD_INVOICE_HEADER_START_COMMENT', 'Header begins here for invoice #');
define('WHITEBOARD_INVOICE_HEADER_END_COMMENT', 'Header ends here for invoice #');
define('WHITEBOARD_INVOICE_BODY_START_COMMENT', 'Body begins here for invoice #');
define('WHITEBOARD_INVOICE_BODY_END_COMMENT', 'Body ends here for invoice #');
define('WHITEBOARD_INVOICE_FOOTER_START_COMMENT', 'Footer begins here for invoice #');
define('WHITEBOARD_INVOICE_FOOTER_END_COMMENT', 'Footer ends here for invoice #');
$header_start_comment = '<!--' . WHITEBOARD_INVOICE_HEADER_START_COMMENT . $invoice_vid . '-->';
@piyuesh23
piyuesh23 / generate_pdf_archived_invoice.php
Created November 20, 2014 10:44
Logic to generate pdf from archived invoices stored in s3
// CONSTANTS defined in whiteboard_migration.module.
// Will be accessible when this module is installed on whiteboard.
define('WHITEBOARD_INVOICE_HEADER_START_COMMENT', 'Header begins here for invoice #');
define('WHITEBOARD_INVOICE_HEADER_END_COMMENT', 'Header ends here for invoice #');
define('WHITEBOARD_INVOICE_BODY_START_COMMENT', 'Body begins here for invoice #');
define('WHITEBOARD_INVOICE_BODY_END_COMMENT', 'Body ends here for invoice #');
define('WHITEBOARD_INVOICE_FOOTER_START_COMMENT', 'Footer begins here for invoice #');
define('WHITEBOARD_INVOICE_FOOTER_END_COMMENT', 'Footer ends here for invoice #');
$header_start_comment = '<!--' . WHITEBOARD_INVOICE_HEADER_START_COMMENT . $invoice_vid . '-->';
@piyuesh23
piyuesh23 / generate_pdf_archived_invoice.php
Last active August 29, 2015 14:10
Logic to generate pdf from archived invoices stored in s3
// CONSTANTS defined in whiteboard_migration.module.
// Will be accessible when this module is installed on whiteboard.
define('WHITEBOARD_INVOICE_HEADER_START_COMMENT', 'Header begins here for invoice #');
define('WHITEBOARD_INVOICE_HEADER_END_COMMENT', 'Header ends here for invoice #');
define('WHITEBOARD_INVOICE_BODY_START_COMMENT', 'Body begins here for invoice #');
define('WHITEBOARD_INVOICE_BODY_END_COMMENT', 'Body ends here for invoice #');
define('WHITEBOARD_INVOICE_FOOTER_START_COMMENT', 'Footer begins here for invoice #');
define('WHITEBOARD_INVOICE_FOOTER_END_COMMENT', 'Footer ends here for invoice #');
$header_start_comment = '<!--' . WHITEBOARD_INVOICE_HEADER_START_COMMENT . $invoice_vid . '-->';
@piyuesh23
piyuesh23 / books.json
Created September 8, 2015 11:20
Contains list of books authored by J. K. Rowling
{
"kind": "books#volumes",
"totalItems": 459,
"items": [
{
"kind": "books#volume",
"id": "669sjA7YvcQC",
"etag": "QhNKdWk0zBc",
"selfLink": "https://www.googleapis.com/books/v1/volumes/669sjA7YvcQC",
"volumeInfo": {