Wednesday, August 26, 2015

Salesforce Sortable Changeset Dependency List

Sorting the results of 'View/Add Dependencies'

When you have to shift through over 100+ entries it would help if SF's interface allowed for sorting. The missing functionality can be achieved by running the below JS, which can be invoked using a handy bookmarklet. Create one as follows:
  • In your browser add a new bookmark
  • Name it `SF Make `<table class='list' ...>` Sortable`
  • In the url paste the blelow JS snippet
javascript:/* `sortTable` from https://gist.github.com/danielsokolowski/994d47baa95ef81fd8fc */ function TableSort(a){this.tbl=a;this.lastSortedTh=null;if(this.tbl&&"TABLE"==this.tbl.nodeName){a=this.tbl.tHead.rows[0].cells;for(var b=0;a[b];b++)a[b].className.match(/asc|dsc/)&&(this.lastSortedTh=a[b]);this.makeSortable()}}TableSort.prototype.makeSortable=function(){for(var a=this.tbl.tHead.rows[0].cells,b=0;a[b];b++){a[b].cIdx=b;var c=document.createElement("a");c.href="#";c.innerHTML=a[b].innerHTML;c.onclick=function(a){return function(){a.sortCol(this);return!1}}(this);a[b].innerHTML="";a[b].appendChild(c)}};TableSort.prototype.sortCol=function(a){var b=this.tbl.rows,c=[],f=[],g=0,d=0;a=a.parentNode;for(var l=a.cIdx,e=1;b[e];e++){var h=b[e].cells[l],h=h.textContent?h.textContent:h.innerText,k=h.replace(/(\$|\,|\s)/g,"");parseFloat(k)==k?f[d++]={value:Number(k),row:b[e]}:c[g++]={value:h,row:b[e]}}b=[];a.className.match("asc")?(e=bubbleSort(c,-1),c=bubbleSort(f,-1),a.className=a.className.replace(/asc/,"dsc")):(e=bubbleSort(f,1),c=bubbleSort(c,1),a.className.match("dsc")?a.className=a.className.replace(/dsc/,"asc"):a.className+="asc");this.lastSortedTh&&a!=this.lastSortedTh&&(this.lastSortedTh.className=this.lastSortedTh.className.replace(/dsc|asc/g,""));this.lastSortedTh=a;b=e.concat(c);c=this.tbl.tBodies[0];for(e=0;b[e];e++)c.appendChild(b[e].row)};function bubbleSort(a,b){var c,f;1===b?(c=0,f=a.length):-1===b&&(c=a.length-1,f=-1);for(var g=!0;g;)for(var g=!1,d=c;d!=f;d+=b)a[d+b]&&a[d].value>a[d+b].value&&(g=a[d],a[d]=a[d+b],a[d+b]=g,g=!0);return a};new TableSort(document.querySelector('table.list'));

Example of sorting the Salesforce Chageset dependency list


If you found this post useful, please post a comment or follow me on twitter .

Tuesday, August 11, 2015

Compass can't find any Sass files to compile.

Is your compass configuration correct?.

Unbelievable, compass chokes on directories with spaces (I think, and at least on a Windows machine).

I have resolved it by creating a junction from the repository into a folder without spaces - see this awesome utility: http://schinagl.priv.at/nt/hardlinkshellext/linkshellextension.html

And food for thought: consider if SASS is needed, do you want to debug your SASS or CSS?

sass-can-not-find-any-files-fix

If this post has saved you hair pulling post a comment and a follow is always appricited.

Friday, August 7, 2015

Freeswitch 1.4 'mod_shout' compiling fails on Debian 8.0

Error: inlining failed in call to always_inline '_mm_loadu_ps'

The error happens when trying to compile the 'lame' needed by the 'mod_shout' module. From Google it appears to only happen on 32bit architecture.

The solution is to search for `xmmintrin.h` and remove the line from file `./lib/lame-3.98.4/configure`. The final code block should look as follows:

...
 for ac_header in \
    errno.h \
    fcntl.h \
    sys/soundcard.h \
    sys/time.h \
    unistd.h \
    linux/soundcard.h
 do :
...

If you found this useful please comment or follow me on twitter @danielsokolows.