Skip to content

Instantly share code, notes, and snippets.

@gopalkumar315
gopalkumar315 / Widget.php
Created June 4, 2016 16:06
Codeigniter - Widget Library (Backup)
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
/**
* Widget Library
* http://codeigniter.com/forums/viewthread/109584/
*
* @version: 0.21
* $copyright Copyright (c) Wiredesignz 2009-09-07
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
@gopalkumar315
gopalkumar315 / jquery.unserialize.js
Created April 6, 2016 17:25 — forked from brucekirkpatrick/jquery.unserialize.js
Takes a string in format "param1=value1&param2=value2" and returns an javascript object. Improved to handle multiple values with same name and to unescape url encoded values.
/**
* $.unserialize
*
* Takes a string in format "param1=value1&param2=value2" and returns an object { param1: 'value1', param2: 'value2' }. If the "param1" ends with "[]" the param is treated as an array.
*
* Example:
*
* Input: param1=value1&param2=value2
* Return: { param1 : value1, param2: value2 }
*
@gopalkumar315
gopalkumar315 / Namespace_Module_Block_Adminhtml_Edit_Tab_XXXX.php
Created February 12, 2016 07:13 — forked from SchumacherFM/Namespace_Module_Block_Adminhtml_Edit_Tab_XXXX.php
Magento backend admin: Edit form with a multiselect field with product categories
<?php
/* Set up: */
class Namespace_Module_Block_Adminhtml_News_Edit_Tab_Linking {
protected function _prepareForm(){
...
$fieldSet->addField('product_categories', 'multiselect',
@gopalkumar315
gopalkumar315 / 0_reuse_code.js
Created January 22, 2016 19:27
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@gopalkumar315
gopalkumar315 / crawler-edit.php
Created December 25, 2015 19:36 — forked from jakzal/crawler-edit.php
Removing nodes with DomCrawler
<?php
<<<CONFIG
packages:
- "symfony/dom-crawler: ~2.3"
- "symfony/css-selector: ~2.3"
CONFIG;
use Symfony\Component\DomCrawler\Crawler;
$html = <<<HTML