Skip to content

Instantly share code, notes, and snippets.

@janherich
Last active January 2, 2016 05:19
Show Gist options
  • Save janherich/8255881 to your computer and use it in GitHub Desktop.
Save janherich/8255881 to your computer and use it in GitHub Desktop.
(->> data
(filter (comp #(re-find #"^([0-9.]+)\s%$" %) #(get % 5)))
(sort-by (comp #(read-string (second (re-find #"^([0-9.]+)\s%$" %))) #(get % 5)) >)
(into []))
@geoflen
Copy link

geoflen commented Jan 16, 2014

Hi Jan......I guess yiu should bill me at the end of the month....buging you alot ....now I have this nested user data which looks like this

{"" {:username "", :password "$2a$10$ZdhEftfkQ61/k0GvXDaLGOtSRw5q6D3ZjfPdXx8GymrBxf3Bhr1fi", :roles #{:administrator}}, "" {:username "", :password "$2a$10$Au1gLG/5K/EJ0CPpBtMYLu7URjzkpyqv2wIC72oJows9I4xOcwlGa", :roles #{:user}},.......} ......have u worked with datatables...want to display username and role using a datatable like so....var oTable;
$(document).ready(function() {

$('#userslist').html( '<table cellpadding="0" cellspacing="0" border="0" class="display" id="example"></table>' );
    $.getJSON("/home/user_list", function(json) {
    oTable = $('#example').dataTable( {
    "aaData": json,
    "aoColumns": [
        { "sTitle": "Role", "sClass": "center", "mdata":"roles"  }
        { "sTitle": "User Name", "sClass": "center", "mdata":"username"  }
    ],
    "fnRowCallback": function( nRow, aData, iDisplayIndex ) {
        /* Append the grade to the default row class name */
        var id = aData[0];


        return nRow;
    },
    "sDom": 'T<"clear">lfrtip',
"oTableTools": {
  "sSwfPath": "../datatables/swf/copy_csv_xls_pdf.swf"
}
} );

});

} );
but no luck yet...any Ideas please?

Cheers!

@geoflen
Copy link

geoflen commented Jan 16, 2014

: username and : password are actuall strings....sorry forgot to include them

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment