This file contains hidden or 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
| # requires ghostscript to be installed first - on mac, install with `brew install ghostscript` | |
| # -sDEVICE=txtwrite - text writer | |
| # -sOutputFile=- - use stdout instead of a file | |
| # -q - quiet - prevent writing normal messages to output | |
| # -dNOPAUSE - disable prompt and pause at end of each page | |
| # -dBATCH - indicates batch operation so exits at end of processing | |
| gs -sDEVICE=txtwrite -sOutputFile=- -q -dNOPAUSE -dBATCH to-be-processed.pdf |
This file contains hidden or 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
| <?php | |
| /************************************************************************* | |
| * Get File Information | |
| */ | |
| // Assuming these come from some data source in your app | |
| $s3FileKey = 's3/key/path/to/file.ext'; | |
| $fileName = 'file.ext'; |
This file contains hidden or 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
| const chunks = (arr, chunkSize) => { | |
| let results = []; | |
| while (arr.length) results.push(arr.splice(0, chunkSize)); | |
| return results; | |
| }; | |
| module.exports = (xs, f, concurrency) => { | |
| if (xs.length == 0) return Promise.resolve(); | |
| return Promise.all(chunks(xs, concurrency).reduce( | |
| (acc, chunk) => acc.then(() => Promise.all(chunk.map(f))), |
This file contains hidden or 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
| # Sample Nginx config with sane caching settings for modern web development | |
| # | |
| # Motivation: | |
| # Modern web development often happens with developer tools open, e. g. the Chrome Dev Tools. | |
| # These tools automatically deactivate all sorts of caching for you, so you always have a fresh | |
| # and juicy version of your assets available. | |
| # At some point, however, you want to show your work to testers, your boss or your client. | |
| # After you implemented and deployed their feedback, they reload the testing page – and report | |
| # the exact same issues as before! What happened? Of course, they did not have developer tools | |
| # open, and of course, they did not empty their caches before navigating to your site. |
This file contains hidden or 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
| <!doctype html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <title>Upload File using jQuery.ajax() with progress support</title> | |
| </head> | |
| <body> | |
| <input type="file" name="file" id="sel-file"/> |
NewerOlder