background preloader

Seven JavaScript Things I Wish I Knew Much Earlier In My Career - Smashing Magazine

Seven JavaScript Things I Wish I Knew Much Earlier In My Career - Smashing Magazine
Advertisement I’ve been writing JavaScript code for much longer than I care to remember. I am very excited about the language’s recent success; it’s good to be a part of that success story. I’ve written dozens of articles, book chapters and one full book on the matter, and yet I keep finding new things. Here are some of the “aha!” moments I’ve had in the past, which you can try out rather than waiting for them to come to you by chance. Shortcut Notations One of the things I love most about JavaScript now is shortcut notations to generate objects and arrays. var car = new Object(); car.colour = 'red'; car.wheels = 4; car.hubcaps = 'spinning'; car.age = 4; The same can be achieved with: Much shorter, and you don’t need to repeat the name of the object. The other handy shortcut notation is for arrays. var moviesThatNeedBetterWriters = new Array( 'Transformers','Transformers2','Avatar','Indiana Jones 4' ); The shorter version of this is: var direction = x < 200 ? JSON As A Data Format Resources

Add subdomains to your local web server with apache | Edward A. Webb (.com) <div class="greet_block wpgb_cornered wpgb_shadowed"><div class="greet_text"><div class="greet_image"><a href=" rel="nofollow"><img src=" alt="WP Greet Box icon"/></a></div>Hello there! If you are new here, you might want to <a href=" rel="nofollow"><strong>subscribe to the RSS feed</strong></a> for updates on this topic.<div style="clear:both"></div></div></div> This will walk through the process of adding sub domains to your local server ( onesite.localhost , twosite.localhost, etc ). To understand this need you are liekly working on multiple sites at once on your local development machine. So lets say you have an excellent CakePHP application, a gnarly JS sandbox, and your personal start page all belonging to different directories. First off I will be be clear that this is instructions for a Linux device. localhost - /srv/www/htdocs/

The Seven Deadly Sins Of JavaScript Implementation - Smashing Magazine Advertisement Using JavaScript has become increasingly easy over the last few years. Whereas back in the day we needed to know the quirks of every browser, now many libraries such as jQuery, YUI, Dojo and MooTools allow someone who doesn’t even know JavaScript to spruce up boring HTML documents with impressive and shiny effects. By piggy-backing on the CSS selector engine, we have moved away from the complexity and inconsistencies of the DOM and made things much easier. If you look at some of the code that has been released, though, we do seem to have taken a step backwards. In gaining easier access, we also became a bit sloppy with our code. The rules for solid, maintainable and secure JavaScript haven’t changed, though. We’ve all had to work with code written by other people. Sins Of Our Fathers: Browser-Specific Code One of the main obstacles that kept us from evolving as developers was that JavaScript was largely browser-specific. Libraries to the Rescue What do I mean by these?

JavaScript : organiser son code en modules Cet article vous propose d'étudier différentes techniques permettant d'isoler votre code dans des modules « hermétiques », évitant ainsi les interactions involontaires avec le reste de votre code, ou avec le code que vous ne contrôlez pas. JavaScript a été initialement conçu pour être un langage facile à prendre en main. Néanmoins, avec l'augmentation importante des volumes de code utilisés sur Internet, on se heurte désormais comme dans la plupart des langages de programmation aux problèmes inhérents à la cohabitation de plusieurs bibliothèques. L'objectif de cet article est de présenter quelques techniques permettant de rendre vos bibliothèques plus faciles à maintenir, plus lisibles et mieux structurées en les organisant sous forme de modules, minimisant ainsi les risques d'interaction involontaire avec l'extérieur. Enoncé du problème Voici tout d'abord un exemple assez simple, qui sera le fil conducteur de cet article : Cette bibliothèque est à première vue plutôt bien écrite : Conclusion

20 Fresh JavaScript Data Visualization Libraries There are plenty of JavaScript libraries out there for rendering your otherwise plain and boring numerical data into beautiful, interactive, and informative visualizations. The beauty of using JavaScript for data visualization is that, if created correctly, your data will be highly accessible (usually via HTML tables). A long time ago (2008), I wrote about JavaScript solutions for graphing and charting data and this article revisits the topic with twenty more JavaScript libraries that you can use to bring your data to life. 1. Highcharts Highcharts is one of the most promising JavaScript charting libraries to hit the scene recently, with its large array of features including seven charting types (line, pie, and bar among them), the ability to zoom in and out of charts, and tooltips for offering more information about data points. 2. gRaphaël gRaphaël is a charting library based on Raphaël, a vector graphics drawing JavaScript library. 3. 4. jQuery Visualize Plugin 5. moochart 6. 7. dygraphs

Web Standards Curriculum - Dev.Opera Create your own Javascript Library Create your own javascript library in these fun, easy steps! Background We all know about the performance benefits of putting all of our javascript/jQuery calls into .js files, so that browsers will cache the whole chunk on the client-side. It’s even more tempting to put all of our complicated jQuery calls into a single file, thus further enhancing performance by reducing HTTP requests (i.e. the browser doesn’t have to download so many files). However, have you ever taken a look at a site using the jQuery Cycle plugin on the homepage? [cycle] terminating; too few slides: 0 This is because the cycle init code, while correctly put inside the DOM-ready function, is still being called on every page, regardless of whether it has a slideshow or not. Most of the time you won’t even notice the extra overhead because jQuery fails gracefully, but it’s still traversing the DOM, looking for elements that aren’t there. Solution Library Shell The Code //hide by default $advancedSearch.slideUp(’3000′); Examples

Aho/Ullman Foundations of Computer Science This book has been taken out of print by W. H. Freeman. You are welcome to use it if you like. We believed in 1992 it was the way to introduce theory in Computer Science, and we believe that today. --- Al Aho and Jeff Ullman Index The Book | Materials | Gradiance | Errata PDF's of the Book PrefaceTable of ContentsChapter 1 Computer Science: The Mechanization of Abstraction Chapter 2 Iteration, Induction, and Recursion Chapter 3 The Running Time of Programs Chapter 4 Combinatorics and Probability Chapter 5 The Tree Data Model Chapter 6 The List Data Model Chapter 7 The Set Data Model Chapter 8 The Relational Data Model Chapter 9 The Graph Data Model Chapter 10 Patterns, Automata, and Regular Expressions Chapter 11 Recursive Description of Patterns Chapter 12 Propositional Logic Chapter 13 Using Logic to Design Computer Components Chapter 14 Predicate Logic Index Supplementary Materials Gradiance Package Available Errata Sheet We are going to try to maintain errata.

45 Powerful CSS/JavaScript-Techniques - Smashing Magazine Advertisement CSS and JavaScript are extremely powerful tools for designers and developers. However, sometimes it’s difficult to come up with the one excellent idea that would solve a problem that you are facing right now. Good news: almost every day designers and developers come up with fresh and clever CSS tricks and techniques and share them with other developers online. We regularly collect all these tricks, filter them, sort them, revise them and prepare them for Smashing Magazine readers. In this post we present 45 useful CSS/JavaScript-techniques that may help you find clever solutions to some of your problems or just get inspired by what is possible with CSS. Please notice that this is the first part of our large round-up of fresh CSS/JavaScript-techniques. Interesting CSS Techniques Building the New Visual AnnotationsThese note overlays are composed of two main elements, an overlay with the shine and a border with the transparency. CSS Navigation Menus Sproing! CSS Lists

Creating your own JavaScript Library One of the phases I went through while learning about JavaScript was the intense desire to write my own library, similar to jQuery (but massively scaled down). My library has gone through several major revisions — and more than one complete re-write, but now is exactly what I started out hoping it would be: functional, clean, small, and a solid learning experience. I’d like to share what I learned from this project, and I hope you share back with me through the comments! Finished project demo Step 1: Identify the purpose of your library This might just be one of the toughest parts of the whole process! Pick one particular function, or aspect of web development/design that you would like your library to handle. I decided my library would be a simple way to manipulate elements visually. Step 2: Mock-up how would use the library You always mock-up a webpage before you start building it right? Have you ever mocked-up your code? We can also tell some design patterns: Step 3: Code up an outline

Blog » Blog Archive » Ruby on Rails - Multiple database connections 21 Apr Found a need for this information while answering questions on railsforum. So, let's say that we want to use two databases and let's even say that we want to use an Oracle database and a MySQL database. How can this be done? To start, we must decide which database will be our default database. So we have all seen that before. But, I need to use data from an oracle database, so let's setup that connection: Neat, we have two development connections. The line we need to add is this: Even better, we can make this dynamic, so when we are in the test or production environment, we don't need to change the establish_connection line. So the final product could look something like this: database.yml Oracle model example That should be it. ShareThis

jQuery++ jQuery Plugin: Tokenizing Autocomplete Text Entry | James Smith • loopj.com This Project Has Moved! For the latest version and awesome documentation, please head over to: Overview This is a jQuery plugin to allow users to select multiple items from a predefined list, using autocompletion as they type to find each item. Features Intuitive UI for selecting multiple items from a large list Layout controlled fully in CSS, easily customisable Result caching reduces server load No images required, just the plugin’s .js file and some CSS Handles json search data for autocompletion Smooth animations when results load Select items using the mouse or keyboard Screenshots Vertical list style item selection Facebook style item selection Demo A live demo of the token input is available here. Usage Latest documentation can be found here: License This plugin is released under a dual license. Quick Download Please don’t use these links directly in your scripts, I might change their location at any time. Github Project About the Author

No More Powerpoint I Have Impress.js In this tutorial you will learn how you don't need to use the old powerpoint presentation software now we have Impress.js. What Is Impress.JS Impress.js is a presentation framework which uses all the new features of CSS3 transforms and CSS transitions to create unique presentations. The idea of Impress.js came from viewing new unique presentations from prezi.com. Lately on Github Impress.js has become very popular and I believe you will start seeing many companies create presentations by using this framework. Impress.js Demos The best way to understand what Impress.js can do is to see some of the presentations that have already been created using the framework. Here is a list of presentations for you to enjoy, they are all much better than using the boring old powerpoint presentations. Official Impress.js Demo CSS 3D transforms CSS 3D Transforms What The Heck Is Responsive Web Design? What The Heck Is Responsive Web Design? Digibury Digibury Wakame Wakame Download

Related: