John Cox

Blogs · @wyome · Now · Shelf

Interesting

10 of the coolest CSS3 and CSS effects | Webdesigner Depot

A grab-bag of CSS3 tricks that replace images and extra markup, written with Chrome/-webkit syntax and a reminder to add other browser prefixes. Text effects include a red/blue anaglyph made with an `:after` duplicate and RGBA offsets, gradient text via mask-image, and dripping text built from stacked text-shadows. Style tricks include a stitched border using a dashed border plus a large box-shadow spread, one-sided shadows via negative spread, and layered-paper stacks made from multiple shadows. It also covers sprite hover rollovers, a fancy-ampersand font suggestion (Cochin, Josefin Sans), iPad media queries for responsive layouts, and a scale transition on nav links. Code samples are loose and sometimes flawed, so it works better as an inspiration list than a reference.

Permalink

Bring back the 40-hour work week - AlterNet - Salon.com

Sara Robinson argues that the 40-hour week was adopted by business, not just forced by unions, because a century of industrial research showed that longer hours yield little or no extra output and raise accident risk. Overtime pays off only in brief sprints. After about eight 60-hour weeks a team gets less done than if it had stayed at 40, and knowledge workers manage only about six productive hours a day. She traces the loss of this knowledge to Silicon Valley's "passion" culture, Tom Peters's promotion of it, and the decline of unions in the Reagan era. She closes by urging workers to confront employers with the data and push for enforcement of labor laws, drawing heavily on Evan Robinson's 2005 game-developer white paper.

Permalink

Regex Tester – RegexPal

A compact regular expression cheat sheet grouped into character classes, anchors, escaped characters, groups and lookaround, and quantifiers with alternation. It lists the core syntax with one-line meanings, such as \w \d \s, [^abc] negation, \b word boundaries, capture versus non-capturing groups, backreferences like \1, positive and negative lookahead, and lazy quantifiers like a+?. Worth keeping as a quick reference for the basics, though it has no lookbehind, flags, or worked examples.

Permalink

CSS Social Buttons

A free master stylesheet (social-buttons.css) for social icon buttons that uses ordinary background-image icons rather than pure-CSS3 or canvas tricks, so it works consistently across browsers. Buttons are built by combining classes on a link or its wrapper: `.sb` plus an icon (twitter, rss, etc.), then any mix of size, color, and style modifiers like gradient, glossy, circle, embossed, or text. The post also covers adding your own icons, overriding size and color, writing custom gradients (with an SVG fallback for IE9), and defining fully custom button styles, with icons drawn from the free Mono Social Icons set.

Permalink

CSS3 Pseudo-Classes and HTML5 Forms | HTML5 Doctor

A HTML5 Doctor guest piece on the CSS3 pseudo-classes that pair with HTML5's native form validation, letting you style fields without JavaScript. It walks through four pairs, each with a short example and demo: :required/:optional, :valid/:invalid, :in-range/:out-of-range for number inputs, and :read-only/:read-write. Practical caveats include that :valid and :invalid apply on page load (so a "submitted" class added via script is needed), that browser error bubbles are hard to restyle, and that Chrome, Opera and Safari had the fullest support at the time while Firefox and IE10 had only partial support.

Permalink

Tokutek | Database Performance

Bài quảng bá Xoilac TV như trang xem bóng đá trực tuyến miễn phí "hàng đầu" Việt Nam, cho rằng xem qua mạng đã thay thế TV nhờ nhanh, tiện và xem ở đâu cũng được. Nội dung chủ yếu là liệt kê điểm mạnh do chính trang tự nói: hình ảnh Full HD, bình luận viên tiếng Việt, hơn ba đường link mỗi trận cập nhật trước giờ đấu một tiếng, ít quảng cáo, kèm tin tức, lịch thi đấu, bảng xếp hạng, highlight và cả mục tỷ lệ kèo, mẹo cá cược với banner nhà cái. Cuối bài là danh sách các trang đối thủ (90Phút, Cakhia, Mitom, K+, VTV…) và thông tin liên hệ, nên đây là bài tự quảng cáo, không có đánh giá độc lập, và các cam kết như "không mã độc" hay "có bản quyền mọi giải" chưa được chứng minh.

Permalink

Automated Deployment of PHP Applications using git | saintsjd

A tutorial for getting a Heroku-style "git push to deploy" workflow for PHP sites, using WordPress as the example. You set up a bare git repo on the web server, clone it both to your laptop and into the live www directory, and add a post-receive hook that runs `git pull` in the live folder whenever master is pushed. It also covers SSH key login, a WordPress .gitignore, and locking down the live `.git` directory with permissions and `.htaccess` so the source isn't publicly readable. Database changes still need to be triggered by visiting wp-admin after each deploy.

Permalink

C. Gerard Gallant: An Introduction to HTML 5 Web Workers

A introductory walkthrough of HTML5 Web Workers, which move long-running JavaScript off the UI thread so pages stay responsive but leave workers without DOM access, communicating instead through postMessage and onmessage. It distinguishes dedicated workers (tied to their creator, simpler) from shared workers (reachable by any same-origin window via a port object and an onconnect handler), with code for feature detection and setup of each. It also notes that workers are costly to start and heavy on memory, and records circa-2010 browser support: dedicated in Firefox 3.5+, Chrome 5+ and Safari 5+, shared only in Chrome and Safari, and neither in IE 8 or 9 Preview.

Permalink

Interpreted Languages: PHP, Perl, Python, Ruby (Sheet One) - Hyperpolyglot

A side-by-side cheat sheet comparing Node.js, Python 3.6, PHP 7.0 and Ruby 2.3 across the core language: syntax, variables, numbers, strings, regexes, dates, arrays, dictionaries, functions, control flow, exceptions and threads. The tables hold the code idioms, and a second section of notes (this copy ends at threads, with the sheet-two topics like files, processes and databases only listed) explains the quirks behind them: PHP's loose null and string comparisons, Python's chained comparisons and `nonlocal` closures, Ruby's blocks, symbols and `rescue` semantics, and JavaScript's `var`/`let` scoping and lodash-dependent helpers. Worth keeping as the one place to look up how to do a given task in one language when you know it in another.

Permalink

(404) http://sugarjs.com/features/

This is the landing page for Sugar, a JavaScript utility library that adds convenience methods for arrays, numbers, strings, and dates, such as summing or averaging object properties, parsing natural-language dates like "last week Friday," truncating text, and abbreviating numbers. It pitches the library as simple, modular (custom builds and npm packages), extensible through plugins, and polyfill-equipped, with a date module that handles many locales. The notable point is the v2.0 change: extending native prototypes is now opt-in rather than default, so users can choose whether to modify built-ins or use Sugar through other interfaces.

Permalink

24 Most Popular jQuery Plugins of February 2012

A roundup of 24 jQuery plugins that were new or updated in February 2012, each with a one-or-two-line description. They cover page-turn effects (turn.js), custom scroll paths, CSS3 3D galleries, full-screen slideshows, sliders (Sequence.js), and background stretching. Utility plugins like noty notifications, jPages pagination, Lazy Load, DataTables 1.9, URL parsing with jurlp, and a responsive Google Maps fallback are also included. It's a quick catalogue for finding tools from that month rather than an in-depth review, and it links back to a similar January 2012 list.

Permalink

XDate - A Modern JavaScript Date Library

XDate is a small (3k gzipped) JavaScript library that wraps the native Date object, keeping the same method names while adding ISO week numbers, token-based formatting (e.g. "MMM d, yyyy", with optional parts like "h(:mm)TT"), add/diff methods, an overflow-safe month setter, and a UTC mode that ignores the client's timezone and DST. Setters and add methods mutate the object and return it for chaining, so use clone() for a copy. It deviates from native Date in that setters return the XDate rather than milliseconds, and string concatenation yields the millisecond value, so call toString() explicitly. This is the reference page for the API, useful for looking up format tokens, constructor forms, and UTC-mode behavior.

Permalink