Author Archives: Roy Sharon

animini – A javascript micro-library for tween animations

animini was built with a single purpose in mind: to be the most convenient to use tween animation library, while keeping it lightweight. I have managed to keep it below 5K, with no external dependencies. As for being convenient, I … Continue reading

Posted in Javascript, Uncategorized | Leave a comment

Batch Rename One-Liner

Following is a simple way to perform batch renaming, using the Command line: ls *.jpg | awk ‘{print(“mv “$1” “$1)}’ | sed ‘s/jpg/jpeg/’ | /bin/sh If you wish to see the renaming commands before they are performed (just to make … Continue reading

Posted in Unix Tidbits | Leave a comment

Fast and Secure Remote File Transfer Using The Command Line

One of the fastest ways to transfer files between remote machines is using SSH: tar -cz *.jpg | ssh <username@host> “tar -xzC <path-to-expand>” This will create a single compressed archive of all jpg files in the current directory, transfer them … Continue reading

Posted in Unix Tidbits | 5 Comments

Unicode Numbers In Javascript

Handling Non-ASCII Numerals In Javascript — The Way It Should Have Been Handled Source code available at uninums on github. A couple of weeks ago, I ranted about the lack of proper Unicode support in Javascript. Granted, Javascript supports Unicode … Continue reading

Posted in Javascript | Tagged , , | 7 Comments

Javascript & Unicode: The Unconsummated Marriage

Why We Need Better Unicode Support for Javascript, And What Can Be Done About It One of the smartest things ECMA did was requiring Javascript engines to use Unicode strings. This has important implications beyond the simple ability to represent … Continue reading

Posted in Javascript | Tagged , | Leave a comment

Scrolling The Selection Into View

Scrolling Text Nodes And Ranges Into View In A Cross-Browser Manner Scrolling an HTML element into view can easily be achieved using the scrollIntoView() function. But what about text nodes, ranges and selections? var o = document.getElementById(‘foo’); o.scrollIntoView(); The scrollIntoView() … Continue reading

Posted in Javascript | Tagged , | 5 Comments

Unix Tidbit: Most Requested Web Resources

This is a quick and dirty way to find the most requested static resources of your site (e.g., images or javascript files), using Unix shell commands: grep -oE “GET /[^ \t]+\.(gif|png|js|css)” /var/log/httpd/access_log \ | sort | uniq -c | sort … Continue reading

Posted in Unix Tidbits | Tagged | Leave a comment

Unix Tidbit: Color Coded Directory Listing

Each time I move onto a new Unix machine (I recently bought a new iMac!), I change the look of the terminal directory listings, from this: to this: It’s quite simple — I edit one of the bash config files … Continue reading

Posted in Unix Tidbits | Tagged | Leave a comment