Scrollable dropdown like google app launcher
Forked from Manar's Pen Google App launcher.
A Pen by Salvador P. on CodePen.
| #!/bin/bash | |
| # Searches for filenames and then copies them to the destination folder. | |
| # Searches for first parameter then copies where the second says. | |
| ls | grep "$1" | while read i; do cp -p "$i" $2 ; done |
| #!/bin/bash | |
| # Renames all files in the actual directory. | |
| # Searches for first parameter then changes for the second. | |
| for f in *; do mv "$f" "$(echo "$f" | sed s/$1/$2/)"; done |
Scrollable dropdown like google app launcher
Forked from Manar's Pen Google App launcher.
A Pen by Salvador P. on CodePen.
| <?php | |
| // Same for hook_node_save! | |
| function my_module_node_update($node) { | |
| if ($node->type == 'content_type_name') { | |
| // Invoke your callback function AFTER the node is updated. | |
| drupal_register_shutdown_function('_my_module_the_function_to_call', $node); | |
| } | |
| } | |
| // Modified from the one found here: https://stackoverflow.com/a/2260289/1540591 | |
| var myLinks = document.getElementsByTagName("a"); | |
| for (var i = 0; i < myLinks.length; i++) { | |
| currentlink = myLinks[i]; | |
| if (currentlink.target.substring(0,12) === "_blank") { | |
| currentlink.click(); | |
| // console.log(currentlink); | |
| } | |
| } |
| pdftk *.pdf cat output joined_pdfs.pdf |
| # Less compression nice results, links broken | |
| ls | cat -n | while read n f; do ps2pdf "$f" "$f.comp2.pdf"; done | |
| # A lot of compression jpg quality loss, respects links, changing PDFSettings can alter results more/less compression/quality | |
| ls | cat -n | while read n f; do gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.5 -dPDFSETTINGS=/ebook -dNOPAUSE -dQUIET -dBATCH -sOutputFile="$f.comp.pdf" "$f"; done |
| # https://stackoverflow.com/questions/3211595/renaming-files-in-a-folder-to-sequential-numbers/34153342#34153342 | |
| ls | cat -n | while read n f; do mv "$f" "$n.extension"; done |