Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am pangorgo on github.
  • I am badsector (https://keybase.io/badsector) on keybase.
  • I have a public key ASCT4xncqi50TPJy83Jcg9ZjGKFG0PJADtbRw1XHl_vs-go

To claim this, I am signing this object:

@pangorgo
pangorgo / convert.sh
Created June 18, 2017 19:18
some batch image convert useful tricks
# cropping largest possible image with prvided ratio
RATIO=960x540; ls *.jpg | xargs -I "{}" convert {} -geometry $RATIO^ -gravity center -crop $RATIO+0+0 resized/{}
@pangorgo
pangorgo / jQuery.whenAll
Last active December 23, 2015 21:59
jQuery.whenAll() is an alternative to jQuery.when() function. Only difference is that whenAll() function do not trigger reject on master deffered immediately after failing any of internal deferreds, but waits for all internal deferreds to change state and then trigger master deffered reject.
jQuery.whenAll = function( subordinate /* , ..., subordinateN */ ) {
//console.log(arguments);
var i = 0,
failed = false,
resolveValues = Array.prototype.slice.call( arguments ),
length = resolveValues.length,
// the count of uncompleted subordinates
remaining = length !== 1 || ( subordinate && jQuery.isFunction( subordinate.promise ) ) ? length : 0,