This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### Keybase proof | |
I hereby claim: | |
* I am jribble on github. | |
* I am jribble (https://keybase.io/jribble) on keybase. | |
* I have a public key ASDm2pv8CHB0RRGC80sWswv3Jf8iAR4YsTVNt-_y1b5jrQo | |
To claim this, I am signing this object: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// async lock using promise | |
// this queues all calls | |
var pending = Q.when(true); | |
function callToServer() { | |
pending = pending.then(function() { | |
return callService("myService", params); | |
}); | |
} | |
// async avoid double call using flag |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package pdfutil; | |
import org.apache.pdfbox.cos.COSArray; | |
import org.apache.pdfbox.cos.COSDictionary; | |
import org.apache.pdfbox.cos.COSName; | |
import org.apache.pdfbox.cos.COSStream; | |
import org.apache.pdfbox.pdmodel.PDDocument; | |
import org.apache.pdfbox.pdmodel.PDDocumentCatalog; | |
import org.apache.pdfbox.pdmodel.PDPage; | |
import org.apache.pdfbox.pdmodel.PDResources; |