Skip to content

Instantly share code, notes, and snippets.

@danwoods
danwoods / README.markdown
Created August 4, 2011 20:43
jQuery plugin to catch image load errors and re-direct src urls

jQuery plugin to catch image load errors and re-direct src urls. Allows for multiple fallback options.

Author: Dan Woodson

@danwoods
danwoods / .Xresources
Last active September 26, 2015 17:48
Personal config files
!! drop in Solarized colorscheme for Xresources/Xdefaults
!!SOLARIZED HEX 16/8 TERMCOL XTERM/HEX L*A*B RGB HSB
!!--------- ------- ---- ------- ----------- ---------- ----------- -----------
!!base03 #002b36 8/4 brblack 234 #1c1c1c 15 -12 -12 0 43 54 193 100 21
!!base02 #073642 0/4 black 235 #262626 20 -12 -12 7 54 66 192 90 26
!!base01 #586e75 10/7 brgreen 240 #585858 45 -07 -07 88 110 117 194 25 46
!!base00 #657b83 11/7 bryellow 241 #626262 50 -07 -07 101 123 131 195 23 51
!!base0 #839496 12/6 brblue 244 #808080 60 -06 -03 131 148 150 186 13 59
!!base1 #93a1a1 14/4 brcyan 245 #8a8a8a 65 -05 -02 147 161 161 180 9 63
@danwoods
danwoods / README.txt
Created August 15, 2011 03:23
Immediate, directing validation with jQuery
Immediate feedback validation
Author: Dan Woodson
Date: 2011-08-14
for ticket GRN-1833
@haschek
haschek / .jshintrc
Created May 4, 2012 16:08
JSHint Configuration, Strict Edition
{
// --------------------------------------------------------------------
// JSHint Configuration, Strict Edition
// --------------------------------------------------------------------
//
// This is a options template for [JSHint][1], using [JSHint example][2]
// and [Ory Band's example][3] as basis and setting config values to
// be most strict:
//
// * set all enforcing options to true
@visnup
visnup / lock.css
Created May 5, 2012 20:31
"lock" orientation of a website for mobile (iPad, iPhone)
/* if portrait mode is detected, rotate the entire site -90 degrees to hint rotating to landscape */
@media (orientation: portrait) {
body {
-webkit-transform: rotate(-90deg);
-moz-transform: rotate(-90deg);
-o-transform: rotate(-90deg);
-ms-transform: rotate(-90deg);
transform: rotate(-90deg);
}
}
@domenic
domenic / portable-node.md
Created May 25, 2012 21:03
Tips for Writing Portable Node.js Code

Node.js core does its best to treat every platform equally. Even if most Node developers use OS X day to day, some use Windows, and most everyone deploys to Linux or Solaris. So it's important to keep your code portable between platforms, whether you're writing a library or an application.

Predictably, most cross-platform issues come from Windows. Things just work differently there! But if you're careful, and follow some simple best practices, your code can run just as well on Windows systems.

Paths and URLs

On Windows, paths are constructed with backslashes instead of forward slashes. So if you do your directory manipulation

@danwoods
danwoods / .jshintrc
Last active October 11, 2015 05:17
JSHint Config file for Me
{
// --------------------------------------------------------------------
// JSHint Configuration for Dan Woodson
// --------------------------------------------------------------------
//
// Note: This is a modified version of the file found at [5].
// The configuration options have been changed to fit the
// needs of Magazines.com
//
// This is a options template for [JSHint][1], using [JSHint example][2]
@danwoods
danwoods / FED_Guidelines.md
Last active December 12, 2015 03:39
FED Guidelines

• Dev Notes:

  • Give every element you can a title
  • All <img>s must have an alt
  • pt_xxx_UI => placeholder for css, injected in
  • pt_xxx_VARS => placeholder for scripts, injected in after footer element, near end of
  • ONLY EDIT THINGS IN app_magazines!!!! NEVER COMMIT CHANGES TO storefront_core OR storefront_richUI
  • EVERYTHING must validate; html, css, etc. All js should be run through magazine's jshint. It is valid now. Don't fuck it up.
  • Always review any changes in all supported browsers => link to wiki page about supported browsers
  • There should never be plain-text copy in the html. Please keep it in content assets/slots or in .properties files. If you find plain-text copy in the site's html, please move it to the appropriate place
@tbjers
tbjers / app.html
Last active December 20, 2015 16:29
Node.js: Scaffolding Modern Web Applications with Flatiron
<!DOCTYPE html>
<html>
<head>
<title>Flatiron Example</title>
</head>
<body>
<div id="body"></div>
</body>
</html>
this.addEventListener("fetch", function(event) {
console.log('WORKER: fetch event in progress.');
/* We should only cache GET requests, and deal with the rest of method in the
client-side, by handling failed POST,PUT,PATCH,etc. requests.
*/
if (event.request.url !== 'https://myserver.ngrok.com/app.js') {
/* If we don't block the event as shown below, then the request will go to
the network as usual.
*/