Bookmarked
Google ASCII Art Easter Egg 1
find more posts in: google
I just searched for “ascii art” on Google and noticed this easter egg: the logo switches to a figlet-style ASCII.
Update: This has been around for a while.
Is it so crazy that someone would play VATFUL? 1
find more posts in: games
I’ve been playing a little bit of Words With Friends lately, and since I don’t have any actual friends I’ve been challenging random opponents. In this particular game MegaPegg freaked out and quit when I played VATFUL.
Is it so hard to believe someone could come up with this six letter word on their own? Especially when there is no penalty for attempting to play an invalid word (the game just lets you know it’s invalid and lets you try another)? My Words With Friends strategy is actually best captured in this Penny Arcade strip.
Sorry MegaPegg, I didn’t realize we weren’t allowed to use words you didn’t know! But I like the fancy accent you added to “douche”!
Now that’s a quesadilla 1
find more posts in: foodAutomatically playing audio with HTML5 and Javascript (even on the iPad) 3
find more posts in: apple, html, ipad, javascript, jquerySay you’re building a game with HTML and jQuery and you want to throw in some sound effects. Before HTML5, you had to resort to a pretty hacktacular approach:
$("#sound").remove(); var sound = $("<embed id='sound' type='audio/mpeg' />"); sound.attr('src', 'beep.mp3'); sound.attr('loop', false); sound.attr('hidden', true); sound.attr('autostart', true); $('body').append(sound);
This sucks for a lot of reasons, and it’s going to be a nightmare to build something that uses a lot of sounds.
HTML5 makes it super easy:
var snd = new Audio('beep.mp3'); snd.play();
Unfortunately I couldn’t get this to work on the iPad. After some digging around I found the answer buried in a Stack Overflow thread. You just have to do snd.load() before you call the play() method.
So, here’s some code that will take care of this, with our lame support for older browsers:
function html5_audio(){ var a = document.createElement('audio'); return !!(a.canPlayType && a.canPlayType('audio/mpeg;').replace(/no/, '')); } var play_html5_audio = false; if(html5_audio()) play_html5_audio = true; function play_sound(url){ if(play_html5_audio){ var snd = new Audio(url); snd.load(); snd.play(); }else{ $("#sound").remove(); var sound = $("<embed id='sound' type='audio/mpeg' />"); sound.attr('src', url); sound.attr('loop', false); sound.attr('hidden', true); sound.attr('autostart', true); $('body').append(sound); } } play_sound('beep.mp3');
Prevent console.log() errors 0
find more posts in: javascriptif(typeof(console) === 'undefined') { var console = {} console.log = console.error = console.info = console.debug = console.warn = console.trace = console.dir = console.dirxml = console.group = console.groupEnd = console.time = console.timeEnd = console.assert = console.profile = function() {}; }
Bookmarked
- Google ASCII Art Easter Egg
- Is it so crazy that someone would play VATFUL?
- Now that’s a quesadilla
- Automatically playing audio with HTML5 and Javascript (even on the iPad)
- Prevent console.log() errors
- Tumblin’
- omgtru updates and iPhone web app lessons learned
- Really?
- Easy form hints: HTML5 input placeholders
- Anthem Type
- apple
- art
- audio
- baseball
- bikes
- books
- browsers
- comedy
- complaints
- crime
- death
- dumb things
- energy
- environment
- family
- fonts
- food
- friends
- gadgets
- games
- henry
- html
- internet
- ipad
- iphone
- itunes
- javascript
- jquery
- life
- los angeles
- marriage
- movies
- msgblorb
- music
- mysql
- new york
- omgtru
- os x
- pasadena
- photos
- php
- plugins
- podcasting
- politics
- portland
- pugs
- rss
- ruby
- splideo
- subversion
- ubuntu
- Uncategorized
- video
- watir
- wordpress
- work
