NodeJS, the hot new non-blocking server-side platform, should probably be on every developer’s “to learn” list. I’m not saying you should use it to develop every project you ever work on from this day forward, but you should definitely commit some time to playing with it and seeing what it’s all about.
And when you do decide to go down this wonderful path of learning, you’ll find something a little unexpected—there are really no NodeJS best practices. There are tons of tutorials out there, some of which are really great and some of which seem like they were written by somebody who just started learning NodeJS for themselves. Add to this the fact that NodeJS is very, very new (created in 2009) and you have a young community full of novices all trying to find their way around without a whole lot of help.
The second problem is that because NodeJS has the ability to be written in very succint ways, tutorials tend to write entire examples as one single, monolithic “app.js” file. This is great when you want to walk somebody through a couple of concepts, but when a young developer copies your code verbatim and expects to turn that into a production-ready web application, a pretty significant problem develops. All of a sudden, there are thousands of lines of code out in the wild, all of which is nearly impossible to maintain…and it’s all because the developers simply didn’t know any better.
Creating your own NodeJS best practices isn’t difficult, either. Many of the principles that go into building maintainable PHP or Rails apps translate very easily to the NodeJS world. But what the NodeJS community needs is a unified forum to share and criticize each others’ opinions of what great NodeJS apps look like, and what young, budding developers can do to follow in those footsteps.
TL;DR: Play with the demo
Scrolling is so tired. Every single website: up, down, up, down. With some projects, when you really need your user experience to stand out and draw somebody in, we have to think outside of the box and play around with the three-dimensional space.
As web browsers continue to get more powerful, however, new opportunities are opening up in three-dimensional space. Imagine, for instance, that instead of scrolling down a long website, you dive deeper and deeper into it. In combination with other two-dimensional navigation, this can literally give your web app depth, and provide a visually interesting way to indicate to your users a hierarchy in your site’s content. It also looks really cool.
There are a number of ways to go about creating 3D effects: There is experimental support for 3D in the HTML5 canvas, and there is also experimental (although slightly more standardized) support for 3D effects in CSS3. In the end, for the sake of compatibility, I decided to “fake” the 3D experience, as the results were essentially the same, and the performance just as good.
I found that by adjusting a combination of scale (increasing/decreasing size), opacity, and blurriness, I could create the effect of a page flying towards or away from a camera, going out of focus, and either disappearing in the distance or behind the “camera.” To keep things looking crystal-clear at any point during this zoom, I used Scalable Vector Graphics (SVG) for most of the design elements. And just for fun, I added some Hammer.js hooks, so users with touchscreens can play with the demo, too.
Play and enjoy: interactive demo
Many of my projects begin with a font. Sometimes, the subtle curves of a certain typeface can define an entire brand. The idea of fonts on a computer is a relatively new idea, and we’re still seeing fonts evolve with the changing times. One of the first typefaces developed specifically for a computer screen was called Chicago. Susan Kare created it for the original Macintosh way back in 1984. It’s a classic sans-serif, and is every bit as notable as Helvetica or Rockwell are today. Inspired by the retro feeling invoked by Chicago, and with free time for some Photoshop fun, I figured a little homage was in order:
You can download a bigger version here.
class properties to identify these elements to jQuery, the HTML5 specification gives us a great tool in the data-* attributes.
You can name these attributes anything you want, for example:
<div data-page-id="3"></div> or <div data-bgimage="http://..."></div>
var div = $('div[data-page-id="3"]');
or you can just get the value of the attribute like this:
var value = $('div').attr('data-page-id');
These attributes and values don’t have to be unique, so you could have several elements with the same “data-page-id” value. You can take advantage of this to connect to the two elements together. Another popular use of the data attribute is to “lazy load” images. For example, one of my projects contains animated GIFs that are complex and about 3-5MB EACH! It wouldn’t make sense to load all of those when the page loads, especially because most of them aren’t visible at first. We can dodge this problem by referencing the large, animated GIF in a data attribute, but only loading a small static one until the image becomes visible in the browser:
<img src="static.gif" data-src="animated.gif"/>
var newImage = $('img').attr('data-src'); $('img').attr('src',newImage);
The possibilities are endless!
2013 is turning out to be a shockingly news-filled year, with fatal tragedies ranging from the Sandy Hook Elementary shooting (technically 2012), The Boston Marathon bombing, and now the deadly explosion in West, Texas. Add to that a series of homicides and jail escapes in my hometown, and you might start to draw the conclusion that we live in a scary, tragic world. And you’d be right.
If there’s one thing to take note of amidst all this suffering, it’s that news travels fast—and with social media, it travels even faster. But why are we drawn to such tragedies? Why is the same sad story so compelling to watch or read again and again?
We’re all familiar with the “adrenaline rush” of doing something dangerous or thrilling. Its caffeine-like jolt can be addictive. With more and more sources of news, from “man on the street” tweets to first-person video from a smartphone, the illusion of “feeling like you’re there” is getting stronger and stronger. The fear of a fire or explosion is intense, and the virtual reality of the news allows us to feel the adrenaline rush of such events without the danger of actually being there. It’s where the news junkie meets the adrenaline junkie.
You may think all of this bad news would just leave you feeling sad and disheartened, but that’s where another hormone comes into play. Oxytocin is a powerful hormone that causes us to feel compassion for others. Our bodies release it naturally as a response to the sadness we experience when seeing others in pain. Oxytocin has some interesting side effects though—it creates intense feelings of bonding and closeness (hint: it’s also released during childbirth and orgasm) that drive us to help out our fellow man however we can. This is all capped off by the fact that we also release a waterfall of endorphins when we donate money or help out, in a phenomenon so strong psychologists call it the “helper’s high.”
Between the rush of adrenaline and the endorphin high of oxytocin, it’s no wonder we have such mixed yet intense feelings about tragic events. It unites us when we’re divided and ignites the fire of activism in each of us. It seems, sad as it may be, that our brains are simply wired to experience—and respond to—the tragedies of everyday life.
There’s no denying that the December 2012 shooting at Sandy Hook Elementary re-ignited the civil discourse on gun control. And after such a tragic event, especially so soon after a similarly shocking shooting in Colorado, it’s hard to blame anyone for wanting to fix a gun violence problem that seems to have gotten out of hand. President Obama, Congress, the NRA, and various lobbying and activist groups all jumped on the bandwagon to console the grieving families in Newtown—and maybe gain a few polling points at the same time. Public opinion on gun control spiked tremendously, with 85% of Americans saying they would support stricter background checks and 80% saying that gun sales to the mentally ill should be prevented.
Months after Sandy Hook, however, support for gun control reform seems to be fading away, falling to nearly the same levels as before the shooting. Support for stricter gun control laws has fallen to 47% since the shooting, and a number of lawmakers are ratcheting back on the ambitious gun control promises they made immediately after the shooting.
Do we forget so quickly?
The current opinion on gun control is not representative of the actual opinion on the subject.Many have criticized what appears to be very slow action on behalf of Congress, and President Obama even said “shame on us” if Newtown becomes forgotten in time. For long-time gun control activists, the Sandy Hook shooting was in many ways a blessing in disguise to wake up America and convince lawmakers to finally improve the country’s seemingly ineffective gun control laws. Just as outspoken after the shooting were the country’s staunch gun rights supporters, who rather courageously (or foolishly, depending on your perspective) said that nothing should change about the culture of gun ownership in America. There is clearly no single, unanimous opinion about the issue, nor is there a clear way to fix the problem, should we seek a way to fix it at all. The modus operandi in local governments and Congress alike, however, seems to be to do something, and do it now.
Is it right to act so soon after such a traumatic event? Are our minds clouded with revenge and the need for closure? Are our lawmakers—and we ourselves as a country—ready to make the best decisions for the future of our society?
The problem is that we are currently outliers to ourselves—the current opinion on gun control is not representative of the actual opinion on gun control, when unaffected by significant external events. Before the Newtown incident, Americans seemed pretty happy to live in a country full of assault weapons and the occasional mass shooting—it just comes with the territory, right? It’s a classic knee-jerk reaction, and we would be taking advantage of an almost unavoidable emotional reaction to accomplish a long-standing political agenda.
I’m not saying whether that political agenda is wrong or right, but perhaps we should wait until we’re all in a “normal” state of mind before deciding what to do about things.
In a relatively rare move, Apple launched a new advertising campaign for the iPhone 5 over the weekend, about halfway through their traditional release cycle. This comes just days after Samsung launched their newest flagship phone, the Galaxy S4. While years ago, Samsung might have been expected to fumble the launch of potentially game-changing phone, they’ve been at their advertising finest, with great (albeit poorly translated) ads and videos, promoting the Galaxy S4 as a “Life Companion” and a fun device to bring you closer to your loved ones. This kind of maudlin emotional appeal kind of reminds you of the sickeningly-sweet TV spots Apple did for FaceTime when it launched.
Apple’s course correction is certainly warranted. A number of high profile iPhone users have been seen switching to Android lately, citing the platform’s rapidly-advancing set of features and the bevy of phones with all-star hardware specs, although some maintain that the extensive “features” in Android phones are more gimmicky than useful, like a built-in kickstand or the ability to chest bump your phone with somebody else, as long as they have the exact same phone that you do. With the launch of Samsung’s newest phone though,round after round of sexy Android phones like the HTC One and the Galaxy S4 have begun a sea change in customers’ opinions.
Now the seemingly unstoppable technology and marketing juggernaut known as Apple is playing a little bit of catch-up. This is something new for the company that has led the smartphone race for the past several years, despite being obviously behind the bleeding edge of technology.
Unless Apple makes a drastic change in its production pace, we won’t be seeing a new iPhone until late in the summer. With several phones on the market capable of blowing the iPhone 5 and the stale iOS out of the water, Apple stands to lose lots of ground while the Galaxy S4 wins hearts and minds. And here we see Apple, which tends to coast on its products’ popularity and let them speak for themselves, giving the iPhone 5 a mid-cycle boost to focus consumers away from the Galaxy S4.
Advertising battles are nothing new, but Apple’s new campaign marks the beginning of a fundamental shift in the smartphone market. Apple has long characterized the playing field as: “There’s iPhone. Then there’s everything else.”
Now it seems that things may be slowly shifting towards: “There’s a lot of options, and one of them’s an iPhone.”
If not for name recognition alone, WordPress is without a doubt one of the most popular publishing platforms on the Internet today. Developers are familiar with it, designers love the simplicity of creating themes, and users love the point-and-click ease of use. But can WordPress really work in the enterprise? I mean, flexibility is one thing, but large companies have a whole spread of other issues to contend with, such as compliance, support, not to mention the need to manage tons of websites with a limited staff.
Making WordPress and the enterprise work together is by no means impossible
At TCU, we’ve been hard at work for months getting WordPress fit for the enterprise. I have to admit, I was skeptical at first. Necessity is the mother of invention though, and after weeks of research and trial and error and inspiration and more trial and error, we’ve finally come up with a WordPress system that’s actually scalable and manageable in an enterprise environment. Here are some tips if you find yourself trying to make WordPress in the enterprise actually work:
Making WordPress and the enterprise work together is by no means impossible, but it definitely takes a little ingenuity and a lot of elbow grease. And as with any project on the web, it’s a perpetual work-in-progress. Don’t be afraid to tweak things as you go along, and never stop learning!
About 100% of this blog’s content revolves around computers, phones, web design, and the other various minutiae of nerdery that occupy my working life. Even the “About me” sidebar of this blog is a professional mask, a facade of myself with the motivation of self-promotion. I’m a huge fan of behind-the-scenes specials about movies and TV shows, so here’s a behind-the-scenes special of my own, even if does harken back to the Xanga days of yore.
I love my wife. As if the ring on my finger and the wedding ceremony weren’t enough to prove it, it’s something that’s important to remember and all too easy to forget. We’ve had a long day of explaining love to teenagers who are ill-equipped to understand it. I spoke to the guys, she spoke to the girls…and even though we were apart, we’ve been brought closer together because of it.
Discussing love with the youth brought us to discussing love with one another, which led to frenzied conversations about money, politics, kids, money again, and love again. And at the end of it, we both realized how much we love each other, if not for the very reason that we’re able to talk about all of these complicated things so very openly. We don’t always agree with each others’ opinions, and at times we seem to be polar opposites. But it’s never an opposition of agression or anger—it’s an opposition of completion.
We’re like the random components of an analog wave that harmonize at just the right points, or the magical happenstance of stars that create our beautiful constellations—different in so many ways, yet perfect in so many more. Where she is weak, I am strong. Where I am foolish, she is wise. We often look back to the way that we met, and the good times we’ve had since then. We’re just old enough now to reminisce about the times that were…and still young enough to dream about what’s to come.
Several years ago, some lyrics came to my mind that I immediately realized were ahead of their time, but still poignant and valuable. Although I’ve never gotten around to writing the entire song, the chorus that came to me in a burst of inspiration before I had even met the future love of my life has been stuck in my head ever since, and only now does it make perfect sense:
You are the wind in my sails,
but I’m the keel that keeps us floating upright
And I am the navigator, but you’re the star
That’s guiding my life tonight.
Google recently announced the newest addition to their Chromebook lineup, the Chromebook Pixel. The Pixel goes against Google’s initial pitch for the Chromebook series, which was to produce inexpensive—almost disposable—laptops with internet access via their Chrome OS.
It seems that Google, just like the rest of the computer-buying public, is starting to realize that cheap, crappy laptops are just that—cheap and crappy. Go figure.
The Chromebook Pixel is an interesting device. It has quality construction at every turn, including a touchscreen “Retina” display, built-in 4G LTE, and a more-than-capable Intel Core i5 processor. It’s nice to see that Google hasn’t lost its whimsical side, however: they decided to include some colored lights on the top, because who doesn’t love some colored lights?