Skip to content

Instantly share code, notes, and snippets.

View rlemon's full-sized avatar
🍋
Hanging around.

Robert Lemon rlemon

🍋
Hanging around.
  • Dryer Moisture Systems Inc.
  • Kitchener, Ontario. Canada.
View GitHub Profile
@rlemon
rlemon / gist:2959767
Created June 20, 2012 12:55
Men Are Just Happier People

#Why Men are happier people..

  • Your last name stays put.
  • The garage is all yours.
  • Wedding plans take care of themselves.
  • Chocolate is just another snack.
  • You can never be pregnant.
  • You can wear a white T-shirt to a water park.
  • You can wear NO shirt to a water park.
  • Car mechanics tell you the truth..

Hello.

I'm trying to make my table have a checkbox column for each row, and also the rows to highlight on hover. It works properly when the data is static declared on html files, however when retrieving the data from server (I'm using $.getJSON) the sorting becomes a mess and the highlight stops working.

Also it shows this message for each row in the table.

DataTables warning: Requested unknown parametr '5' from the data source for row 0

Here is my code:

var Base64={_keyStr:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",encode:function(c){for(var a="",d,b,f,g,h,e,i=0,c=Base64._utf8_encode(c);i<c.length;)d=c.charCodeAt(i++),b=c.charCodeAt(i++),f=c.charCodeAt(i++),g=d>>2,d=(d&3)<<4|b>>4,h=(b&15)<<2|f>>6,e=f&63,isNaN(b)?h=e=64:isNaN(f)&&(e=64),a=a+this._keyStr.charAt(g)+this._keyStr.charAt(d)+this._keyStr.charAt(h)+this._keyStr.charAt(e);return a},decode:function(c){for(var a="",d,b,f,g,h,e=0,c=c.replace(/[^A-Za-z0-9\+\/\=]/g,"");e<
c.length;)d=this._keyStr.indexOf(c.charAt(e++)),b=this._keyStr.indexOf(c.charAt(e++)),g=this._keyStr.indexOf(c.charAt(e++)),h=this._keyStr.indexOf(c.charAt(e++)),d=d<<2|b>>4,b=(b&15)<<4|g>>2,f=(g&3)<<6|h,a+=String.fromCharCode(d),64!=g&&(a+=String.fromCharCode(b)),64!=h&&(a+=String.fromCharCode(f));return a=Base64._utf8_decode(a)},_utf8_encode:function(c){for(var c=c.replace(/\r\n/g,"\n"),a="",d=0;d<c.length;d++){var b=c.charCodeAt(d);128>b?a+=String.fromCharCode(b):(127<b&&2048>b?a+=String.fromCharCode(b>>
6|192
/*
Tb. Tb.
:$$b. $$$b.
:$$$$b. :$$$$b.
:$$$$$$b :$$$$$$b
$$$$$$$b $$$$$$$b
$$$$$$$$b :$$$$$$$b
:$$$$$$$$b---^$$$$$$$$b
:$$$$$$$$$b ""^Tb
$$$$$$$$$$b __...__`.
@rlemon
rlemon / gist:3090947
Created July 11, 2012 14:58 — forked from Zirak/gist:3086939
xhr for dummies

So, you want to send a motherfucking XMLHttpRequest (XHR, or commonly and falsly known as AJAX.) Too bad, just ran out of motherfucking XMLHttpRequests; but I still have one regular. XHR is not magic. It does not autofuckinmagically send things the way you want them do be sent. It does not do the thinking for you. It just sends an Http Request.

You get a hold on such a prime beast like this:

@rlemon
rlemon / gist:3146260
Created July 19, 2012 19:36
Javascript F U
function FF() { return "F"; }; function UU(){ return "U";};
var i,F,f=FF(); j=0,U=[],u=UU(), i = 0,F=[],
F[i++]=f, U[j++]=u, U[j++]=u,
F[i++]=f, U[j++]=u, U[j++]=u,
F[i++]=f, U[j++]=u, U[j++]=u,
F[i++]=f, U[j++]=u, U[j++]=u,
F[i++]=f, U[j++]=u, U[j++]=u,
F[i++]=f, U[j++]=u, U[j++]=u,
F[i++]=f, U[j++]=u, U[j++]=u,
D = function(a,b){return a+b}, U[j++]=u, U[j++]=u,
@rlemon
rlemon / gist:3151021
Created July 20, 2012 14:29
trolololol
var a = 'abcdefghijklmnopqrstuvwxyz1234567890.',
i = 18, j = 0,
b = [a[i++],a[++i],a[++j],a[--i-1],a[i],a[--i-1],a[++j*(j+j)],a[--i-(j+j)],a[j*j+j]].join(''),
f = function(x,y) { switch(x){case(1):o=y;break;case(0):l=y;break;} return y; }, o,l,
c = [a[b](i+j)[0], a[b](i++,i), f(1,a[b](--i-(++j),i-(--j))), f(0,a[b](--i-((j++)+j), (i++)-(--j+j))) ].join(''),
e = o + l,
d = c+Array(++j+j).join(e);
alert(d); // you mad bro?
@rlemon
rlemon / gist:3183650
Last active October 7, 2015 15:07
Gitnologic
Fork it, use it, break it, fix it,
Comm it, push it, pull - request it,
Fetch it, branch it, patch it, fake it,
Merge it, git: it, never - https: it.
Write it, cut it, paste it, save it,
Build it, check it, quick - rewrite it,
Clone it, crack it, crop it, comp it,
Drag and drop it, gzlib - gzip it.
$('body').append('<style>.avatar img { -moz-transition: ease all 100ms; -webkit-transition: ease all 100ms; -ms-transition: ease all 100ms; -o-transition: ease all 100ms; transition: ease all 100ms; } .avatar:hover img { -webkit-transform: rotate(-720deg) scale(4.2); -moz-transform: rotate(-720deg) scale(4.2); -ms-transform: rotate(-720deg) scale(4.2); -o-transform: rotate(-720deg) scale(4.2); transform: rotate(-720deg) scale(4.2); z-index: 99999; opacity: 1;}</style>');
@rlemon
rlemon / gist:3297381
Created August 8, 2012 18:35
ROT13 in js
["string"].map(function(a){return(a=(a)?a:this).split("").map(function(b){if(!b.match(/[A-Za-z]/)){return b}c=b.charCodeAt(0)>=96;k=(b.toLowerCase().charCodeAt(0)-96+12)%26+1;return String.fromCharCode(k+(c?96:64))}).join("")}).join("");