Skip to content

Instantly share code, notes, and snippets.

View RodrigoEspinosa's full-sized avatar
:bowtie:
 

Rodrigo Espinosa Curbelo RodrigoEspinosa

:bowtie:
 
View GitHub Profile
<?php
### --- Snip --- ###
App::after(function($request, $response)
{
// HTML Minification
if(App::Environment() != 'local' and $response instanceof Illuminate\Http\Response)
{
$output = $response->getOriginalContent();
@RodrigoEspinosa
RodrigoEspinosa / gist:3663781
Created September 7, 2012 06:21
DOM to JSON parser for jQuery
function DOM2JSON(){
var Items = new Array;
$(".contenedor").each(function(index){
var label = $(this).children("label").text();
var type = $(this).children("input, textarea")[0];
var name = $(this).children("input, textarea").attr("name") || null;
var placeholder = $(this).children("input, textarea").attr("placeholder") || null;
Items.push(new Item(label, type, name, placeholder));
});
return Items;