58: Running a jQuery on your jDatabase
2009-08-02
Download MP3 For Geekons Episode 58
Pop-Up: jQuery
- jQuery is an awesome JavaScript library that takes the guesswork out of cross-platform 2.0'ing of your webs.
- The sad fact of the matter is far too many of us old-school web developers refuse to use flash or javascript, primarily due to compatibility and accessibility.
- Plus, back in the day, people used JavaScript in place of HTML (I know! How could anyone be JavaScript dependent).
- Now, many people are using progressive enhancement as a means of adding 2.0 to their webs without depending on JavaScript, which means messing with the DOM a lot.
- Messing with the DOM is messy, hard to keep track of, and takes tons of code to accomplish a little bit of cool.
- That's where jQuery comes in.
- jQuery has one of the simplest methods of traversing and manipulating the DOM I've seen in a JavaScript library.
- To make things even easier for common applications (such as file uploads, star ratings, etc.) there are many community-developed plugins with simple examples and good documentation.
- jQuery is easy to implement, just copy a javascript file to your web host, add it to your web page using a standard script tag in your header, then start using the jQuery syntax to quickly and easily accomplish common tasks without needing to worry if it will work in the most popular browsers.
- It is currently being used primarily by small websites, like Google, Dell, Bank of America, Digg, NBC, CBS, Netflix, etc.
- 5 out of 5 stars, easy to use, robust, cross-browser, cross-platform, enterprise-quality, free, and open source.
Geek-Tweak: Working with large files in Inkscape
- As we've mentioned in episodes 1, 45, and briefly in 54, Inkscape is just about the most awesome vector image illustrator out there.
- Because of this, I've gotten in the habit of using it for everything I can. (From icons, to web graphics, user interface elements, cutouts of photographs, even project time lines.)
- When working on huge files, you really start to see where Inkscape gets bogged down: vector blurs.
- Unfortunately, vector blurs are way too awesome to not use, so I've got two really quick tips for working with huge files in Inkscape:
- First: Create Raster images of complicated layers, and continue adding vector elements on top. Here's how:
- Always try to use layers for different areas of your image, so if you are designing a website, maybe have a "shell" of what every single page of your website will have in the background as the first layer, the header with menu as the second layer, and individual content on the third layer.
- If your background layer has tons of blurs, vector masks, and other resource-intensive elements, just hide everything but that layer and export to PNG at 90dpi.
- Now, create a new layer directly above the background later called "Background Raster" and throw the PNG file in there.
- Hide the regular vector background (DON'T DELETE IT) and lock it so you don't mess anything up, and now you can quickly add new elements on top without forcing Inkscape to re-render all of the blurs every time you change something on-screen.
- Just remember to hide the raster layers and show the vector layers when rendering your final image.
- Second: Work with outlines for most of your tweaking and general shaping.
- Still use layers for different areas of your image, but this time have fun with however many blurs, vector masks, groups, clip objects, etc.
- When you start to feel that things are getting a little too slow, press the Control and the number 5 from the keypad.
- All of your objects turn into basic outlines allowing you to zoom in, make tweaks, and move objects around without waiting for the blurs to render after each change.
- Now, just zoom out, press Control + Keypad 5 again, and you're back in business editing a pretty awesome looking image.
- I actually used both of these techniques for the geekons.com redesign and it made editing, rendering, and tweaking the document so much quicker and more efficient.
- The developers are looking for ways to make the blurs quicker to work with and speed improvements for the interface, but for now, these two methods should help make the design process much quicker for complicated images.
View-Source: Passing by Reference
- In most programming languages there are two ways to pass a variable to a function: by reference, and by value.
- As a PHP developer, the default method is by value, and that means I send a copy of a variable to a function or method, and that function messes with the copy, then returns the output as something new entirely.
- This leads me to the question every theologian asks themselves at one point in their education: "If obeying God's word were a function, would I be passing myself by reference, or value?"
- Okay, maybe not EVERY theologian asks themselves that, but I'm sure at least one did at one point.
- Going to church is great, and reading the bible is awesome, but if I only pass myself by value (by separating my personal life from my religious life) then I'm not being changed.
- In Daniel 2, 3, and 6 we see three instances of people who passed themselves by reference, and were completely changed by God's will.
- In chapter 2, God revealed the meaning of king Nebuchanezzer's dream and he faithfully told the king. The King closed the conversation with "Surely your God is the God of gods and the Lord of kings and a revealer of mysteries, for you were able to reveal this mystery." and promptly gave Daniel the root password to the Kingdom's servers.
- In chapter 3, Rack, Shack, and Benny were obedient to God's law not to bow to Nebuchanezzer's statue (or any other idols for that matter) and were thrown into the furnace. After coming out unscathed, king Nebuchanezzer once again praised the true God and said that no god could save the way their God could.
- In chapter 6, Daniel was tossed into a den of lions and sealed in there overnight because he continued to obey God and pray to Him regularly. The next morning, he was found untouched, and king Darious was so glad and amazed that he claimed Daniel's God was the living God who endures forever.
- In all three instances the actions that caused the kings to be amazed and impacted were developed through being changed by God, not by going to church or even evangelizing.
- Under the new covenant, evangelism is directly listed as part of God's will for us, so evangelism is important, but the starting point of all effective ministry is passing ourselves by reference to God, so he can change every part of us dramatically.
- We aren't just passing him a few nodes of an array, or even the entire right fork of a binary tree, but are passing our entire lives into His hands for Him to mold.
- fair warning: He may set you to zero before beginning His work... but for me, I think that would be a good thing.
Key Verses: