Choosing good CSS class names

Naming things is by far the most difficult part of writing CSS. This is because we can’t predict the future. A class name might make perfect sense one day, then the design changes, and it’s a misnomer the next day. We’re then tasked with refactoring our markup and styles so that they make sense. Yuck.

Functional class names vs. Content-based class names vs. Presentational class names.

Naming CSS Stuff Is Really Hard →

Related quote:

There are only two hard things in Computer Science: cache invalidation, naming things, and off-by-one errors.

— Phil Karlton

Elsewhere , , , Leave a comment

Debugging Chrome using the Firefox Debugger

Developing across multiple browsers and devices is the main issue developers have when building applications. Wouldn’t it be great to debug your app across desktop, Android, and iOS with one tool? We believe the Web is powerful enough to offer a Mobile Web development solution that meets these needs.

Enter an experimental Firefox add-on called the Firefox Tools Adapter that connects the Firefox Developer Tools to other major browser engines. This add-on, is taking the awesome tools we’ve built to debug Firefox OS and Firefox on Android to the other major mobile browsers starting with Chrome on Android and Safari on iOS. So far these tools include our inspector, debugger, and console.

Firefox Add-on Enables Web Development Across Browsers and Devices →

Elsewhere , , , , 1 Comment

The Sound So Loud That It Circled the Earth Four Times

4363_c0a62e133894cdce435bcb4a5df1db2d

Think, for a moment, just how crazy this is. If you’re in Boston and someone tells you that they heard a sound coming from New York City, you’re probably going to give them a funny look. But Boston is a mere 200 miles from New York. What we’re talking about here is like being in Boston and clearly hearing a noise coming from Dublin, Ireland. Travelling at the speed of sound (766 miles or 1,233 kilometers per hour), it takes a noise about 4 hours to cover that distance. This is the most distant sound that has ever been heard in recorded history.

The Sound So Loud That It Circled the Earth Four Times →

(via Kottke)

Related: this video of a recent volcanic explosion which I retweeted about a month ago. Note the clearly shockwave as a result of that explosion.

Elsewhere , , Leave a comment

The Physical Web

physical-web

The Physical Web is an approach to unleash the core super power of the web: interaction on demand. People should be able to walk up to any smart device: e.g. a vending machine, a poster, a toy, a bus stop, a rental car, and not have to download an app first in order to use it. The user experience of using smart devices should be much like we use links on web, just tap and use.

The Physical Web is, at its base, a discovery service where URLs are broadcast and any nearby device can receive them. This takes the web we know and love and unlocks exciting new ways to interact.

URLs for everything! Discovery is done using Bluetooth

The Physical Web →
The Physical Web: The Big Idea →

Elsewhere , Leave a comment

Build your own PHP Framework with Symfony Components

switch($_SERVER['PATH_INFO']) {
    case '/':
        echo 'This is the home page';
        break;
    case '/about':
        echo 'This is the about page';
        break;   
    default:
        echo 'Not found!';
}

Good introduction on the Sitepoint website to getting started with a few of the Symfony Components. Starts with the example code above and – one by one – introduces the very basic Symfony Components into the code. Components covered:

  • HttpFoundation
  • HttpKernel
  • Routing
  • EventDispatcher

Build your own PHP Framework with Symfony Components →

Related: bramus/router, my own PHP routing component which I use in my courses. Other typical classes – such as Request and Response classes and their derived variants such as JsonResponse for example – which would accompany this router do exist, yet I haven’t gotten to publishing them.

Elsewhere , , Leave a comment

Monit – Easy, proactive monitoring

check host localhost with address 127.0.0.1
      if failed ping then alert        
      if failed port 3306 protocol mysql then alert
check process apache with pidfile /var/run/httpd.pid
      start program = "/etc/init.d/apache2 start"
      stop  program = "/etc/init.d/apache2 stop"

Monit is a small Open Source utility for managing and monitoring Unix systems. Monit conducts automatic maintenance and repair and can execute meaningful causal actions in error situations.

Monit – Easy, proactive monitoring of processes, programs, files, directories, filesystems and hosts →

Elsewhere , , Leave a comment

The Ultimate Guide To iPhone Resolutions

iphone-sizes

Points, Pixels, Device Pixels.

The Ultimate Guide To iPhone Resolutions →

Elsewhere , , Leave a comment

The Bézier Game

bezier-game

Draw Bézier curves that fit in the shape drawn on screen.

The Bézier Game →

Elsewhere , , Leave a comment

Building OS X Apps with JavaScript

post-image-jsosx-controls

OS X Yosemite introduced JavaScript for Automation. This makes it possible to access native OS X frameworks with JavaScript.

The result above can be built using this code:

ObjC.import("Cocoa");

var styleMask = $.NSTitledWindowMask | $.NSClosableWindowMask | $.NSMiniaturizableWindowMask;
var windowHeight = 85;
var windowWidth = 600;
var ctrlsHeight = 80;
var minWidth = 400;
var minHeight = 340;
var window = $.NSWindow.alloc.initWithContentRectStyleMaskBackingDefer(
  $.NSMakeRect(0, 0, windowWidth, windowHeight),
  styleMask,
  $.NSBackingStoreBuffered,
  false
);

var textFieldLabel = $.NSTextField.alloc.initWithFrame($.NSMakeRect(25, (windowHeight - 40), 200, 24));
textFieldLabel.stringValue = "Image: (jpg, png, or gif)";
textFieldLabel.drawsBackground = false;
textFieldLabel.editable = false;
textFieldLabel.bezeled = false;
textFieldLabel.selectable = true;

var textField = $.NSTextField.alloc.initWithFrame($.NSMakeRect(25, (windowHeight - 60), 205, 24));
textField.editable = false;

var btn = $.NSButton.alloc.initWithFrame($.NSMakeRect(230, (windowHeight - 62), 150, 25));
btn.title = "Choose an Image...";
btn.bezelStyle = $.NSRoundedBezelStyle;
btn.buttonType = $.NSMomentaryLightButton;

window.contentView.addSubview(textFieldLabel);
window.contentView.addSubview(textField);
window.contentView.addSubview(btn);

window.center;
window.title = "Choose and Display Image";
window.makeKeyAndOrderFront(window);

By the looks of if you’re writing Cocoa, in a JavaScript syntax. Reminds me of the fact that you can record Photoshop actions in either VBScript or JavaScript code … and even translate those to C#.

Building OS X Apps with JavaScript →

Elsewhere , , Leave a comment

Cubic Bezier Curves – Under the Hood

Because, math!

Elsewhere , , , 1 Comment